![MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual Download Page 153](http://html1.mh-extra.com/html/macromedia/coldfusion-4-5-developing-web/coldfusion-4-5-developing-web_develop-manual_3286369153.webp)
Chapter 10: Building Dynamic Forms
127
Input Validation with JavaScript
In addition to native ColdFusion input validation using the VALIDATE attribute of the
CFINPUT and CFTEXTINPUT tags, the following tags support the ONVALIDATE
attribute , which allows you to specify a JavaScript function to handle your CFFORM
input validation:
•
CFINPUT
•
CFSLIDER
•
CFTEXTINPUT
•
CFTREE
JavaScript objects passed to the validation routine
The following JavaScript objects are passed by ColdFusion to the JavaScript function
you specify in the ONVALIDATE attribute:
•
form_object
•
input_object
•
object_value
Handling failed validation
The ONERROR attribute allows you to specify a JavaScript function you want to
execute in the event of a failed validation. For example, if you specify a JavaScript
function to handle input validation in the ONVALIDATE attribute you can also specify
a JavaScript function in the ONERROR attribute to handle a failed validation, which
returns a false value. ONERROR is available in the following CFFORM tags:
•
CFINPUT
•
CFSELECT
•
CFSLIDER
•
CFTEXTINPUT
•
CFTREE
When you specify a JavaScript routine in the ONERROR attribute, ColdFusion passes
the following JavaScript objects to the specified routine:
•
form_object
•
input_object
•
object_value
•
error message text
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...