-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: BalajiKrishnan
Message 1 in Discussion
Hi ALL,
<o:p> </o:p>
I have a image button (Server side)<o:p></o:p>
On the image button click I am calling a function in code behind<o:p></o:p>
<o:p> </o:p>
Now to validate two text boxes,I have added a javascipt function, if the
validation fails it should not submit and the code behind function should not
get executed.<o:p></o:p>
<o:p> </o:p>
View.Attributes.Add("onClick","doDateCheck(StartDate,EndDate);");<o:p></o:p>
<o:p> </o:p>
function doDateCheck()
{ alert(from);
alert(to);
if (Date.parse(from.value) > Date.parse(to.value))
{ alert("The dates are invalid.");
return false;
}
}<o:p></o:p>
I am getting the values in the javascript function and the validation is also
done, but the image button is getting submitted and the code behind function is
called.<o:p></o:p>
<o:p> </o:p>
What could be the problem.<o:p></o:p>
<o:p> </o:p>
Balaji.<o:p></o:p>
<o:p> </o:p>
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]