If you are going to use cfform you may as well use the inbuilt validation on
cfinput..





"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Doug Brown
To: CF-Talk
Sent: Thu Nov 23 17:29:36 2006
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:261576
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