|
Post by bgroves on Oct 14, 2014 0:02:04 GMT
I want to use an Alert window to inform the user that form data has been successfully transmitted. I also made the fields required and checked the "validate form" button. I added "alert('hello') ("hello" just for testing) to the events/click code editor of my Submit button. Unfortunately, they both work together whenever an item fails the "required" test upon clicking "Submit", so I am - simultaneously - informing the user that he failed to enter a required field, and that everything worked fine.
I tried adding "if(validateForm()) alert('hello');" to the Click event. This didn't work - I'm guessing that may be because the validateForm function is off in auto.js and therefore separated from the events program flow, but that's just a w***a** guess. Any ideas on how I can code an alert window to open only when validation is true?
EDIT - After reviewing js syntax, I corrected the event code to if (validateForm()) {
alert('Success');
} but it still won't work. I've had 28 views so far and no replies. Can't some guru either solve the problem, or tell me it can't be done in Antenna? To repeat - "code an alert window to open only when validation is true".
|
|
|
Post by J on Nov 3, 2014 17:08:15 GMT
Hi Bgroves,
Validation occurs just before the form is sent, so your alert would appear before the form was submitted - the 'success' message would be premature. However when the form is submitted, you've already left the page, so any alert you've coded no longer exists at that point.
Idea: Try setting the submit button Target property to target a named I-Frame on the same page as your form. That way you can get the form success page to appear in the I-Frame instead of loading as the main page. In effect the I-Frame becomes your alert window, displaying the success/error page as appropriate.
Cheers, J
|
|