|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Need to have a javascript that selectively validates
Author: Whittingham, P
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32542#163330
Jim,
i presume session1 is a field name within your form and you want the validation
at on submit event....remember javascript is a case-sensitive language
unlike CF.
The Javascript Bible, by Dan Goodman is an excellent book
Pat
<script>
<!--
function valid() {
if (document.forms[0].session.value == 'yes' ) &&
(document.forms[0].field2.value != '' or document.forms[0].field3.value != '')
{
alert("field 2 and field3 are required....");
return false;
}
return true;
}
</script>
<form name="x" onsubmit="return valid(); " >
......
</form>
I have a web form that I need javascript validation for if
Session1 is "yes" then field2 and field3 are required.
If session 1 is "no" then field 2 and field3 are not required.
Can someone point me in the right direction. I want to use javascipt because the
rest of the form validation is using it.
Jim Louis
_____
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||