gbecker Posted July 27, 2017 Report Share Posted July 27, 2017 On a submission form I have a required field that needs to contain a code from the sponsor of the person signing up. I have made the field required but I also need to make sure it is valid by checking the database to make sure it already exists. What is the best way to accomplish this? Thanks Quote Link to comment Share on other sites More sharing options...
Vitalikssssss Posted July 28, 2017 Report Share Posted July 28, 2017 On 7/27/2017 at 7:49 AM, gbecker said: On a submission form I have a required field that needs to contain a code from the sponsor of the person signing up. I have made the field required but I also need to make sure it is valid by checking the database to make sure it already exists. What is the best way to accomplish this? Thanks Hello gbecker, I would suggest creating a separate table with promotion codes and use this table as a Lookup table in your Submission form. You should add a Virtual field to your Submission Form and use Cascading form element in order to retrieve a value from the Lookup table. You may use HTML blocks to hide the Virtual field from your users as described in this article. You can use my JS code example below as a reference: <SCRIPT LANGUAGE="JavaScript"> function myFunction(){ var v = document.getElementsByName("cbParamVirtual2")[0].value; if(v) { return true; } else { alert("Wrong code"); return false; } } document.getElementById("caspioform").onsubmit=myFunction; </SCRIPT> subraasingapore 1 Quote Link to comment Share on other sites More sharing options...
gbecker Posted July 30, 2017 Author Report Share Posted July 30, 2017 Thank you Vitalikssssss.. I will give this a try. One question, how to I automate the process of adding new signups to the Lookup Table. Is there a way to add someone to the Lookup after they have signed up? Quote Link to comment Share on other sites More sharing options...
Vitalikssssss Posted July 31, 2017 Report Share Posted July 31, 2017 On 7/30/2017 at 6:52 AM, gbecker said: Thank you Vitalikssssss.. I will give this a try. One question, how to I automate the process of adding new signups to the Lookup Table. Is there a way to add someone to the Lookup after they have signed up? 3 Please provide the details of your workflow. Perhaps, you can use GUID datatype to generate the promotion code automatically in lookup table. GUID A system-generated and globally-unique identifier value, typically used as a complex unique value. Data-types Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.