473,662 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I prevent the validators firing when a button is clicked?

Hello,

I have a page with some validators, all of which work fine. I want to
add a Cancel button to the page, so that if the user decides not to fill
in the form, they can click Cancel and go back to where they were
before.

Trouble is that clicking the Cancel button fires the validators and
stops the page being submitted. How can I get around this?

TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #1
4 1418
Alan Silver wrote:
Hello,

I have a page with some validators, all of which work fine. I want to
add a Cancel button to the page, so that if the user decides not to
fill in the form, they can click Cancel and go back to where they were
before.

Trouble is that clicking the Cancel button fires the validators and
stops the page being submitted. How can I get around this?

TIA


The button has a CausesValidatio n property that is default "true" ...

Hans Kesting
Nov 19 '05 #2
<snip>
Trouble is that clicking the Cancel button fires the validators and
stops the page being submitted. How can I get around this?


The button has a CausesValidatio n property that is default "true" ...


Thanks for the fast and accurate response. I'm sure Ill get the hang of
all this one day ;-)

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #3
In ASP.Net 2.0. you have also ValidateGroup property which specifies group of
controls affected by validation.
--
C# Dev
"Alan Silver" wrote:
<snip>
Trouble is that clicking the Cancel button fires the validators and
stops the page being submitted. How can I get around this?


The button has a CausesValidatio n property that is default "true" ...


Thanks for the fast and accurate response. I'm sure Ill get the hang of
all this one day ;-)

--
Alan Silver
(anything added below this line is nothing to do with me)

Nov 19 '05 #4
>In ASP.Net 2.0. you have also ValidateGroup property which specifies group of
controls affected by validation.


Yeah, and I've wished that was in 1.1 a few times!! I hope they get 2.0
out of beta soon, there are so many new features I would like to use,
but I'm not putting a beta version on a production server!!

Thanks for the reply

--
Alan Silver
(anything added below this line is nothing to do with me)
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2259
by: Nick Bell | last post by:
I have a general form validation question. I know very little about javascript, a little more about PHP. Using yav (http://yav.sourceforge.net): <form method="POST" name=edit onsubmit="return performCheck('edit', rules, 'classic');" action="pages_edit_submit.php"> <input type="text" name="title"> <input type="submit" name="Save"> <input type="submit" name="Cancel"> </form>
1
11082
by: Stan | last post by:
If a page has a button with event handler private void btnAdd_Click(object sender, System.EventArgs e) { ....... } this event handler fires every time I refresh the page in the browser with F5 AFTER the button was clicked.
1
1201
by: cksj | last post by:
I have a button that will trigger validators. In one special case, I have to show a message box when the button is clicked. In the code behind, I added the following: cmdAccept.Attributes.Add("onclick", "javascript:checkPayment();") The message box will not show because of the validators. It will only show if I set CausesValidation=False on the the button. Is it possible to have validators on the button as well as pop-up a message box...
7
1350
by: angus | last post by:
Dear all, I have 5 textboxes, and 2 buttons in a webform. 1-3 textboxes would be validated by 3 Required Field Validators if button 1 is click; 4-5 textboxes would be validated by 2 Required Field Validators if button 2 is click. I have found whether i click button 1 or button 2, textboxes 1-5 will be
15
2914
by: Billy | last post by:
Anyone know if this a bug in VB.NET 2002 and how to overcame that situation? I have a MDI form from where I call MDI child form like that: Dim frm As New frmChild() frm.MdiParent = Me frm.Show() On that child form I have some textboxes. When form show up Leave event
3
1935
by: rgparkins | last post by:
Hi I am currently having problems with Validators in a user control. I am creating a wizard sign-up process which have the allocated step (hyperlinks" at the top of the page. A user can also click next/previous. Dependant on the current step in the sign-up process I am loading a new user control as I dont want to have 7-8 pages, just one page and load the control dynamically. All is sweet at the moment apart from the validation...
1
3097
by: Andrew Jocelyn | last post by:
Hi I have a Formview control in a UserControl. The server-side validation is not working, i.e. the events are not firing when a button control which causes validation is fired or even when Page.Validate() is explicitly called. I'm loading the FormView as an IBindableTemplate as in this article but I don't think this is the reason for the validation not working. http://www.developerfusion.co.uk/show/4721/
2
1116
by: Jordan S. | last post by:
I'm experimenting with dynamically inserting custom composite Web server controls onto a page. For testing purposes I have two custom composite Web server controls that each have a couple of TextBox controls and a "submit" button, as well as required field validators for each of the textboxes. What I'm finding is that when both of these Web server controls appearon the page, clicking on the "submit" button of either of the controls causes...
2
1811
by: Alec MacLean | last post by:
Hi, I have a page using AJAX. The page has three modal popups that work fine when I don't have field validators in place. As soon as I put a validator in place, the popup "form" the validator is part of still works, but the click events (postback) of the other popups is stopped. So, I have two data entry forms I want to validate, each within their own modal Popup panels. The system detects the user type accessing the page and this...
0
8343
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8545
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5653
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1992
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.