VALIDATE

<< Click to Display Table of Contents >>

Navigation:  General Functions > Configuring the MIE (Programmer's Guide) > Portal Design > Software Request Portal Design (Programmer's Guide) > Template Construction >

VALIDATE

The {%VALIDATE%} tag is used to insert javascript that will be used to perform client-side validation of data that is input by the user.  The Gen2 SRP includes ESI's javascript library, which includes several routines for performing validation.  Many of the routines have a "DIV" variation, in which the DIV that contains the control whose value is to be validated is passed to the routine.  The routine performs validation only if the containing DIV is currently visible.

Generally, the validation javascript is written as a single routine that returns true if all validation checks pass, false otherwise.

The syntax is as follows:

{%VALIDATE~~<javascript for performing validation>%}

 

Example:

{%VALIDATE~~

<script type="text/javascript" language="javascript">
<!--
function Validate() {
if(testforRequiredDIV('divWorkstation','SRPWksDevID550','Asset # or Device ID')==false){return(false);}
if(testOptionDIV('divSRPSvrReqType550','SRPSvrReqType550','Server Request Type')==false){return(false);}

return(true);
}
-->
</script>

%}