By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,886 Members | 1,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,886 IT Pros & Developers. It's quick & easy.

How to Ignore a Asp:Button or asp:linkbutton click

P: n/a
RSB
Hi

I am executing a JavaScript Function for a Button and doing some custom data
validation.
Now i want to Ignore the Button Click if the Data validation Fails. i am
using return(false) in the JavaScript Function but that does not work.

Please help.
Thanks
RSB
Nov 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi RSB,

Have you tried adding a custom validator ?
This best fits in this situation. Keep a custom validator and enable disable
the CustomValidator based on the Data validation you are doing.
PS: You may also need to add the Serverside code also for the
customvalidatior.

Regards
Ashish M Bhonkiya

"RSB" <rs*****@hotmail.com> wrote in message
news:MH*****************@news.cpqcorp.net...
Hi

I am executing a JavaScript Function for a Button and doing some custom data validation.
Now i want to Ignore the Button Click if the Data validation Fails. i am
using return(false) in the JavaScript Function but that does not work.

Please help.
Thanks
RSB

Nov 18 '05 #2

P: n/a
try event.cancelBubble = true;

Av.
"RSB" <rs*****@hotmail.com> wrote in message
news:MH*****************@news.cpqcorp.net...
Hi

I am executing a JavaScript Function for a Button and doing some custom
data
validation.
Now i want to Ignore the Button Click if the Data validation Fails. i am
using return(false) in the JavaScript Function but that does not work.

Please help.
Thanks
RSB

Nov 18 '05 #3

P: n/a
RSB
Hi Avnrao,
Could you please explain where to put or how to use this code..
thanks
RSB
"avnrao" <av*@newsgroups.com> wrote in message
news:uA**************@TK2MSFTNGP11.phx.gbl...
try event.cancelBubble = true;

Av.
"RSB" <rs*****@hotmail.com> wrote in message
news:MH*****************@news.cpqcorp.net...
Hi

I am executing a JavaScript Function for a Button and doing some custom
data
validation.
Now i want to Ignore the Button Click if the Data validation Fails. i am
using return(false) in the JavaScript Function but that does not work.

Please help.
Thanks
RSB


Nov 18 '05 #4

P: n/a
Make sure that you AutoPostBack Property is set to false on the buttons.
"RSB" <rs*****@hotmail.com> wrote in message
news:MH*****************@news.cpqcorp.net...
Hi

I am executing a JavaScript Function for a Button and doing some custom data validation.
Now i want to Ignore the Button Click if the Data validation Fails. i am
using return(false) in the JavaScript Function but that does not work.

Please help.
Thanks
RSB

Nov 18 '05 #5

P: n/a
RSB
Hi Ben
i am using a Linkbutton and cannot find the AutoPostBack property for the
link button..

thanks RSB

"Ben Dewey" <As*********@hotmail.com> wrote in message
news:e3**************@TK2MSFTNGP11.phx.gbl...
Make sure that you AutoPostBack Property is set to false on the buttons.
"RSB" <rs*****@hotmail.com> wrote in message
news:MH*****************@news.cpqcorp.net...
Hi

I am executing a JavaScript Function for a Button and doing some custom data validation.
Now i want to Ignore the Button Click if the Data validation Fails. i am
using return(false) in the JavaScript Function but that does not work.

Please help.
Thanks
RSB


Nov 18 '05 #6

P: n/a
set the href to a javascript function like this..
href="javascript:MyFunction()";

you can write event.cancelBubble in MyFunction to true and return false;

Av.
"RSB" <rs*****@hotmail.com> wrote in message
news:MH*****************@news.cpqcorp.net...
Hi

I am executing a JavaScript Function for a Button and doing some custom
data
validation.
Now i want to Ignore the Button Click if the Data validation Fails. i am
using return(false) in the JavaScript Function but that does not work.

Please help.
Thanks
RSB

Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.