Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I take it you're submitting the form with a different target window; hence the form staying in place.</p> <p>There are several options.</p> <ol> <li>Keep the submit button disabled and do ongoing validation in the background, polling the form for changes to fields and then firing off the validation request for a field as it changes. When the form is in a valid state, enable the button; when it isn't, disable the button. This isn't perfect, as there will tend to be a delay, but it may be good enough for whatever you're doing.</li> <li>Do basic validation that doesn't require round-trips to the server in a handler for the form's <code>submit</code> event, then submit the form and remove it (or possibly just hide it). If the further validation on the server detects a problem, it can return a page that uses JavaScript to tell the original window to re-display the form.</li> <li>Use a session cookie and a unique form ID (the current time from <code>new Date().getTime()</code> would do); when the form is submitted, disable its submit button but keep it visible until the response comes back. Make the response set a session cookie with that ID indicating success/failure. Have the window containing the form poll for the cookie every second or so and act on the result when it sees it. (I've never done this last one; not <em>immediately</em> seeing why it wouldn't work.)</li> </ol> <p>I expect there are about a dozen other ways to skin this cat, but those are three that came to mind.</p> <p><em>(Edit)</em> If you're not submitting to a different target, you might want to go ahead and do that -- to a hidden <code>iframe</code> on the same page. That (possibly combined with the above or other answers) might help you get the user experience you're looking for.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload