About This Code
Brief Description:
SubmitDocument function that controls the document submit.
Contributor:
Andrew Jones
Last Modified:
17 Jun 2002
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
The submitDocument function includes the input validation function calls to test the field values, as shown below: <script language="JavaScript"> function submitDocument() { form = document.forms[0]; if ( parent.failNull (
form.ProfileApprovers1, "You must specify one or more approvers for the first approval step","text"))
return; if ( parent.failContains(
form.EditProfileFormKeyOverride_1, "N", "You must select Yes to continue.", "radio") )
return;
if ( parent.failContains( form.EditProfileFormKeyLabel_4, ',;:',"Labels/questions cannot contain commas, colons, or semicolons.", "text", "mult"))
return;
form.submit();
} </script>
<!-- -->
<input type="button" name="Submit" onClick="SubmitDocument()">
Usage / Example