It would be onsubmit="return validateZip();".

I'd recommend NOT using cfforms and rolling your own JS. They tend to screw
each other up and that could be something hard to debug for someone who
admittedly isn’t that great with JavaScript to begin with. 

.... now where did I put that pumpkin pie. S.O.B we don’t have any
Cool-Whip!!!!

..:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
 


-----Original Message-----
From: Doug Brown [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 23, 2006 12:30 PM
To: CF-Talk
Subject: JS hangup

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:261583
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to