473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
6 3202
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JCE | last post by:
I need to programmatically invoke an asp:Button click event from a javascript function. The page containing the script and the button is the HTML page associated with a WebUserControl-derived...
1
by: Timothy V | last post by:
Hi, How do i make an asp:Button execute its Click event when the Enter key is pressed? Thanks in advance, Tim.
3
by: Rea Peleg | last post by:
Hi all This is so Bizarre - asp button click event is working perfectly on one page. I duplicated this page in order to use it again with minor modifications but there the button wont work.. ...
4
by: DBLWizard | last post by:
Howdy All, I am trying to get the data from a row of a data grid in asp.net This is a data grid with five columns (two of the hidden) as follows: <asp:datagrid id="grdMatching"...
4
by: R.A.M. | last post by:
Hi I have very simple problem - I need to process asp:Button click at server. I have written (my experience is little) in .aspx: <asp:Button ID="GoTo" runat="server" Text="Go To"...
1
by: R.A.M. | last post by:
Hello, I have very simple problem which I present here second time, because I haven't got a solution. I need to process asp:Button click at server. I have written (my experience is little) in...
2
by: jimwest1995 | last post by:
Hello, How can i use ASP click button to call procedure Thank you
4
by: anudu | last post by:
hi, im dveloping a web system using vs 2008. in my page i have a ajax page method wich is called by javascript function . in onsuceeded method i want to force the save button on my page to be...
2
by: veenna | last post by:
hi, Page.ClientScript.RegisterOnSubmitStatement On page submission i am calling some javascript function.i want avoid calling that function on asp button click. I know if i give ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.