473,549 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bypass validation on cancel

Can anyone point me to some documentation on bypassing validation controls
when a user selects cancel?

What I have is a user control with a form to fill out information on a
subject. The user should be presented with two buttons a "Submit" and a
"Cancel". When the "Cancel" button is selected all of the items on the user
control should be cleared. However, I have validation controls setup for
each item necessary on the form and when hitting cancel all of the
validation controls activate preventing cancel from being activated. How
can I make this button "bypass" the validation sequence so that just the
form is cleared?

This seems like it would need to be a javascript handled event on the client
side so that it acts like a 'clear' method and doesn't actually submit
anything. I could write that in to the application but I'm wondering if
there is a way to do this in ASP.NET "style" without having to introduce
javascript.

Thanks,
Corey
Nov 17 '05 #1
1 5471
Corey,

I had the same problem but if you set the CauseValidation property of the
cancel button to False your problem is solved.

regards,

Jurjen de Groot
G.I.T.S. Netherlands

"Corey Olsen" <pb****@gnyjro. arg> wrote in message
news:e$******** ******@TK2MSFTN GP11.phx.gbl...
Can anyone point me to some documentation on bypassing validation controls
when a user selects cancel?

What I have is a user control with a form to fill out information on a
subject. The user should be presented with two buttons a "Submit" and a
"Cancel". When the "Cancel" button is selected all of the items on the user control should be cleared. However, I have validation controls setup for
each item necessary on the form and when hitting cancel all of the
validation controls activate preventing cancel from being activated. How
can I make this button "bypass" the validation sequence so that just the
form is cleared?

This seems like it would need to be a javascript handled event on the client side so that it acts like a 'clear' method and doesn't actually submit
anything. I could write that in to the application but I'm wondering if
there is a way to do this in ASP.NET "style" without having to introduce
javascript.

Thanks,
Corey

Nov 17 '05 #2

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

Similar topics

2
3362
by: Bart Lateur | last post by:
I'd like to have validation of the inputted text, in a form textbox. I want to give the user the option to try again, or to cancel out after which the textbox is either cleared or restored. I just don't succeed. In the before_update event, I can cancel out the change, after which the input box keeps the focus. Fine. But I can't change the...
5
3230
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and I use an argument to difference between an 'edit' vs. and 'add. But since I have field validation on both 'footer' and 'edit' columns I can't submit...
5
2033
by: Tina | last post by:
the Edit, Update, Cancel, and Delete buttons in my datagrid are causing validation elsewhere on the page. I want to specify that these buttons should not cause validation but they have no design time property of causevalidation. How can I keep them from causing validation? Thanks, T
5
3804
by: Micky | last post by:
VB v7.1.3088 NET v1.1.4322 SP1 My mate has a strange problem regarding the ESC key and validation. When he hits the Cancel button on his form, the form does not validate. This is correct behaviour of course. However, he also wants this same behaviour when hitting ESC on the keyboard. It was my understanding that when you assign a button...
2
5757
by: jsimons | last post by:
If the user accidentally clicks the X close button I'm using the following code in the form unload event to stop them from accidentally quitting Access. Private Sub Form_Unload(Cancel As Integer) Select Case MsgBox("Are you sure you want to exit?", vbYesNo) Case Is = vbYes Exit Sub Case Is = vbNo Cancel = True
5
3527
by: Jon Paal | last post by:
how can I bypass the open/save/cancel dialog box and have the document requested open directly in the application associated with the file type ?
2
2718
by: Thomas Guignard | last post by:
Hi there I need to run an XSLT stylesheet on XML files generated by another app that seem to have errors. When I try to run my XSLT processor (MSXML engine, run through the Cooktop editor), I get the following error message ERROR: pattern constraint failed. The element: '{http://www.loc.gov/MARC21/slim}leader' has an invalid value...
1
1586
by: Ganesh | last post by:
Hi There, I've a validation control in my page, In some cases i don't want to check the validation like when users click cancel, i'l take the page to home page. But it checks always validation. How can i ignore the validation when i click cancel Thanks Ganesh
1
1962
by: cwby1966 | last post by:
I am Trying to validate information entered into 4 fields on a form. They can not be empty. If one of the fields is empty then the code should give a message athen stop. If all fields are valid then it should continue. I have listed the code below, can some give direction. Private Sub GetProjid_Click() If Forms!! = "" Then MsgBox "You have...
0
7546
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7985
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7503
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...
0
7830
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...
1
5387
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5111
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...
0
3496
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
784
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.