I have a cred form that creates business listings for a directory site. There are a lot of fields, including several image fields, and sometimes the delay between clicking submit and the form submission being complete can be quite long. I'm wondering if there is a class applied to the form, or body while the form is submitting, or a javascript event I can hook into, so I can add an overlay to the page and a message that the listing is being created.
I tried the jquery submit event, but that event fires before validation has taken place. I need an event for when the toolset cred validation is complete and the form is *actually* being submitted. The submit event basically fires when the submit button is clicked, and if there are validation errors on the form, it still fires. Is there a 'validation complete' javascript event that I could use?
I'm using the redirect option, but the problem is that the form takes so long to submit that I need a way to tell them to wait until the redirect happens.
Is there anything you can think of that I can use to determine that the clicking the submit button resulted in the form actually being submitted? Like can I check if the validation error is shown at the beginning of the form, or something like that?
Hi, Shane is on vacation this week so I'm taking a look at his tickets. There's no public JavaScript API available for Forms, so there's no event to hook into for validation. If the Form does not use AJAX, you might be able to set up some custom JavaScript that detects whether or not some URL parameter exists when the page loads, then use that detection script to trigger the browser scroll position to update to the top of the Form. That would help inform the User that some validation error has occurred. If the Form uses AJAX, you might be able to use jQuery's global AJAX events to detect Form submission responses and trigger the scrolling manually based on those responses, but these solutions involve custom code that falls outside the scope of support we provide here since there is no public JavaScript API for Forms.