MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual page 166

Table of Contents

Advertisement

146
Reviewing the code
The following table describes the highlight code and its function:
Code
<script>
<!--
function testbox(form) {
Ctrl = Form.inputbox1;
}
//-->
</script>
onvalidate="testbox"
message="Sorry, your entry is not a valid
See the following Web site for information on JavaScript validation scripts: http://
www.dannyg.com/javascript.
if (Ctrl.value == "" ||
Ctrl.value.indexOf ('@', 1) == -1 ||
Ctrl.value.indexOf ('.', 3) == -1)
{
return (false);
}
else
{
return (true);
}
email address."
Chapter 9 Building Dynamic Forms
Description
JavaScript code to test for valid
entry in the text box. The if
statement checks to making
sure that the field is not empty
and contains an at sign (@) that
at least the second character
and a period (.) that is at least
the fourth character.
Calls the JavaScript testbox
function to validate entries in this
control.
Message to display if the
validation function returns a
false value.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 5-DEVELOPING and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 5

Table of Contents