<p><p>that what I thought.</p><p>What event on the textbox should I use? "change"?</p><p>Will the Form wait for the response before it continues to check the condition?</p></p>
I am sorry (I don't know why the html tags are showing in my reply)
It sounds like you may not be too familiar with Ajax. You set a listener on the change event for your email field. When the value changes, it will trigger your Ajax code to run. It have absolutely nothing to do with the form "waiting". When your AJAX RESPONSE is received from the server, you parse it and populate your hidden field.
I understand what ajax is.
But In my case, the condition that I am testing is immediately after the user enters their email in the field.
So the hidden field essentially will not have a result from.the ajax call at the time that it's needed (unless the form waits for the result of the call to populate the hidden field. )
My probel is that the ajax call is asynchronous, I need it to be synchronous.... So it gets the result
Does that make any sense?
The form does nothing while the Ajax runs. You trigger the Ajax to retrieve the data when the email address is entered or changed. Your users will not always type their email address correctly so you put your jQuery listener on the email field's change event. As soon as the email field is populated or changes, your AJAX will run and populate the hidden field. You can also have better control over the conditionals by managing them yourself in the same jQuery function that populates the hidden field.
This is a very simple task you're trying to achieve with Formidable and custom Ajax.
Thank you.
Can you elaborate more (or send me a link) to the last part of your comment?
"You can also have better control over the conditionals by managing them yourself in the same jQuery function that populates the hidden field."
I am running into a problem
I am using Conversational Forms and the ".change()" jQuery does not trigger if the person enters their email and hits Enter or Next
.change() has been deprecated since jQuery 3.3. The preferred method is the change event: https://api.jquery.com/change/
How do you know the code isn't firing? How are you debugging the code?
Please login or Register to submit your answer