Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1797 How do I add another statement to an onSubmit validation when it already has one?

You are here: irt.org | FAQ | JavaScript | Form | 7.3 | Q1797 [ previous next ]

A good validation is called thus: <form onSubmit="return validate(this)"> where validate returns true to allow submission and false to disallow it

Some scripts at irt.org will show you how to submit more than one form or redirect to a thank you page. To add a statement to the onSubmit, change it to

<form  onSubmit="ok = validate(this); if (ok) someOtherFunction(); return ok">

Submitted by Michel Plungjan

©2018 Martin Webb