- September 20, 2010 at 5:02 pm #570
Dennis @ PerfectFormsBlocked
A frequently asked question is how do I prevent users from submitting duplicate instances? What I like to do is collect something unique like an email address and then search all existing form instances for that same value in that same field. Here is how:
You will need to create a form connection to your form (the subject form). In the form connection use the email address field as the send parameter and any other mandatory field as the return. You can even use the email address field as the return value.
When the email address input field changes data build a connect behavior. Use the email address as a send parameter and use a hidden field for the target of the return parameter. Make sure that in the properties of the connect behavior the check box for “show error messages” in not checked.
Then use a simple branch to determine if the hidden field has a value in it or is empty. If there is a value in the hidden field, then you know that another instance has already been submitted with the same email address. You can use a show message behavior to inform the user and a set state to disable the submit button. On the other half of the simple branch behavior (true or false depending on how you have built it) you might want to have another set state to set the state of the submit button to normal just in case they change their email address.
Here is the URL for the section in our documentation about form connections: /Documentation/manual/html/?how_a_form_calls_the_connectio.htm
You must be logged in to reply to this topic.