Being that I having nothing to do other than eat like a pig, I figured I
would step away from platters of food and goof around on the computer.
Anyways, I absolutely hare JS and suck at it's usage. I have a form I am
trying to validate and no matter what, it the form field is not filled in,
the damn thing submits anyhow. I have put the call to the function both in
the form and the button control and still no go. What am I doing wrong?
<SCRIPT language="JavaScript">
function validateZip(){
if (document.qSearch.zip.value == "")
{
alert("testing");
document.qSearch.zip.focus();
}
return false;
}
</SCRIPT>
<cfform name="qSearch"
action="index.cfm?page=cresults#session.amper##session.URLTOKEN#"
onsubmit="validateZip()">
<cfinput type="text" name="zip" value="">
<cfinput type="submit" name="qSearchSubmit" value="Search" class="sbutton"
/>
</cfform>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:261574
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4