Happy New Year!
Excuse me for going a little off topic, but I am a bit confused...
Please consider the following:
<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
<!--
function _validateText1() {
var validate = document.form1.text1.value;
if (validate.length < 1) {
window.alert("Please enter a value
for Text 1.");
}
}
function _validateText2() {
var validate = document.form1.text2.value;
if (validate.length < 1) {
window.alert("Please enter a value
for Text 2.");
}
}
// -->
</script>
</head>
<body>
<form name="form1">
<input type="Text" name="text1" onblur="_validateText1()">
<input type="Text" name="text2" onblur="_validateText2()">
</form>
</body>
</html>
Is there a way to dynamically send the form name and input box name to the
JavaScript functions as variables so I only have to write one function that
would validate all input text boxes in the form? Is there a better way to
do an input validation on an "onblur" event that what I am trying to do? Is
there a CF tag that can perform this same function easier on an "onblur"
event? I know I can use <cfform... and <cfinput... and specify the required
attribute, but this only appears to validate upon form submittal and it is
requested to perform this validation on a blur event - prior to form
submittal.
Any help would be appreciated.
_____
Gary L. Alford
Manufacturing Operations Project Specialist
Bell Helicopter XWorx
Phone: (817) 280-6233 Fax: (817) 278-6233
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
I have not failed. I've found 10,000 ways that won't work.
Thomas A. Edison
_____
----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe:
http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe:
http://www.dfwcfug.org/form_MemberRegistration.cfm