onSubmit

onSubmit Client Scripts execute whenever the user saves the form, whether they click Save, Submit, or Update.

It's important to understand that any asynchronous code in an onSubmit Client Script runs the risk of not executing, as the form may reload before it has a chance to receive a response from the server! For this reason, any necessary queries or other server requests, should be performed synchronously in an onSubmit script. This is nearly the only situation in which you should intentionally run scripts synchronously in a client-side script.

Additionally, onSubmit Client Scripts have the benefit of being able to tacitly allow or prevent submission before the data is sent to the server, by simply returning a boolean true or false. Because of this facet, onSubmit Client Scripts are an excellent way to validate data on the form, or even use a JavaScript confirm() to confirm some intention with the user.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.140.153