473,888 Members | 1,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with validator

Hi,

I have a page with one <form></form>.

This page contains 2 part forms with 2 buttons, one for each part form.

<form>

Part 1
<date>
<requiredfiledv alidator>
<button1 OnClick="btn1_O nClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_O nClick">

</form>

Part 1 of the form has a required field with a date that must be field in
before clicking button1.

Problem is when I click button2 required field validator from form part 1
fires up.

How can I disable required field validator from form part 1 when I click on
button2.

Thanks
Nov 18 '05 #1
8 1232
There is no great solution for this situation until ASP.NET 2.0 comes out
next year.
The current built-in validator controls don't support this functionality.
You'll have to build your own custom validator functionality I suspect.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"News" <ge**@lycos.com > wrote in message
news:eJ******** ************@ma gma.ca...
Hi,

I have a page with one <form></form>.

This page contains 2 part forms with 2 buttons, one for each part form.

<form>

Part 1
<date>
<requiredfiledv alidator>
<button1 OnClick="btn1_O nClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_O nClick">

</form>

Part 1 of the form has a required field with a date that must be field in
before clicking button1.

Problem is when I click button2 required field validator from form part 1
fires up.

How can I disable required field validator from form part 1 when I click on button2.

Thanks

Nov 18 '05 #2
I tried CustomValidator , problem is that it fires up only if text box is
populated with some content and does not work as required field validator
(what I need it for, to make sure that date is filled in).
"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:ey******** ******@TK2MSFTN GP10.phx.gbl...
There is no great solution for this situation until ASP.NET 2.0 comes out
next year.
The current built-in validator controls don't support this functionality.
You'll have to build your own custom validator functionality I suspect.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"News" <ge**@lycos.com > wrote in message
news:eJ******** ************@ma gma.ca...
Hi,

I have a page with one <form></form>.

This page contains 2 part forms with 2 buttons, one for each part form.

<form>

Part 1
<date>
<requiredfiledv alidator>
<button1 OnClick="btn1_O nClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_O nClick">

</form>

Part 1 of the form has a required field with a date that must be field in before clicking button1.

Problem is when I click button2 required field validator from form part 1 fires up.

How can I disable required field validator from form part 1 when I click

on
button2.

Thanks


Nov 18 '05 #3
Hi.

It's extreamly easy to resolve this problem. Just set the Enabled property
of all validators on the page to "False". Than modify it to "True" in a
definite event handler only for validators that you want to be working. Thus
others will stay disabled.

Regards,

Vladimir

"News" <ge**@lycos.com > wrote in message
news:eJ******** ************@ma gma.ca...
Hi,

I have a page with one <form></form>.

This page contains 2 part forms with 2 buttons, one for each part form.

<form>

Part 1
<date>
<requiredfiledv alidator>
<button1 OnClick="btn1_O nClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_O nClick">

</form>

Part 1 of the form has a required field with a date that must be field in
before clicking button1.

Problem is when I click button2 required field validator from form part 1
fires up.

How can I disable required field validator from form part 1 when I click on button2.

Thanks

Nov 18 '05 #4

.... oh yes, and triger Page.Validate() method after that!
"Vladimir" <co***@ukr.ne t> wrote in message
news:u9******** ******@TK2MSFTN GP09.phx.gbl...
Hi.

It's extreamly easy to resolve this problem. Just set the Enabled property
of all validators on the page to "False". Than modify it to "True" in a
definite event handler only for validators that you want to be working. Thus others will stay disabled.

Regards,

Vladimir

"News" <ge**@lycos.com > wrote in message
news:eJ******** ************@ma gma.ca...
Hi,

I have a page with one <form></form>.

This page contains 2 part forms with 2 buttons, one for each part form.

<form>

Part 1
<date>
<requiredfiledv alidator>
<button1 OnClick="btn1_O nClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_O nClick">

</form>

Part 1 of the form has a required field with a date that must be field in before clicking button1.

Problem is when I click button2 required field validator from form part 1 fires up.

How can I disable required field validator from form part 1 when I click

on
button2.

Thanks


Nov 18 '05 #5
Tried that, in the OnClick method but but it did not work, in what method I
can set it?
blagodar'u Vladimir

"Vladimir" <co***@ukr.ne t> wrote in message
news:eX******** ******@TK2MSFTN GP12.phx.gbl...

... oh yes, and triger Page.Validate() method after that!
"Vladimir" <co***@ukr.ne t> wrote in message
news:u9******** ******@TK2MSFTN GP09.phx.gbl...
Hi.

It's extreamly easy to resolve this problem. Just set the Enabled property
of all validators on the page to "False". Than modify it to "True" in a
definite event handler only for validators that you want to be working. Thus
others will stay disabled.

Regards,

Vladimir

"News" <ge**@lycos.com > wrote in message
news:eJ******** ************@ma gma.ca...
Hi,

I have a page with one <form></form>.

This page contains 2 part forms with 2 buttons, one for each part form.
<form>

Part 1
<date>
<requiredfiledv alidator>
<button1 OnClick="btn1_O nClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_O nClick">

</form>

Part 1 of the form has a required field with a date that must be field in before clicking button1.

Problem is when I click button2 required field validator from form
part 1 fires up.

How can I disable required field validator from form part 1 when I

click on
button2.

Thanks



Nov 18 '05 #6
Look, you have to make all your validators in aspx code with
"Enabled"=False . In this case whatever button you click - no one will work.
Than in some OnClick event handler you should write

private void SomeButton_OnCl ick (.......)
{
.......
_MyValidator1.E nabled = true;
Page.Validate()
.....
}

Run it in debug mode and be shure that your event is handled by this method
and keep track of all steps. If your validator change it's state to enabled
and then Page revalidates itself, all must work. And it do works 100%.

Regards,

Vladimir

"News" <ge**@lycos.com > wrote in message
news:gz******** *******@news04. bloor.is.net.ca ble.rogers.com. ..
Tried that, in the OnClick method but but it did not work, in what method I can set it?
blagodar'u Vladimir

"Vladimir" <co***@ukr.ne t> wrote in message
news:eX******** ******@TK2MSFTN GP12.phx.gbl...

... oh yes, and triger Page.Validate() method after that!
"Vladimir" <co***@ukr.ne t> wrote in message
news:u9******** ******@TK2MSFTN GP09.phx.gbl...
Hi.

It's extreamly easy to resolve this problem. Just set the Enabled property of all validators on the page to "False". Than modify it to "True" in a definite event handler only for validators that you want to be
working.
Thus
others will stay disabled.

Regards,

Vladimir

"News" <ge**@lycos.com > wrote in message
news:eJ******** ************@ma gma.ca...
> Hi,
>
> I have a page with one <form></form>.
>
> This page contains 2 part forms with 2 buttons, one for each part form. >
> <form>
>
> Part 1
> <date>
> <requiredfiledv alidator>
> <button1 OnClick="btn1_O nClick" >
>
> Part 2
> <name>
> <address>
> <button2 OnClick="btn2_O nClick">
>
> </form>
>
> Part 1 of the form has a required field with a date that must be
field in
> before clicking button1.
>
> Problem is when I click button2 required field validator from form

part
1
> fires up.
>
> How can I disable required field validator from form part 1 when I

click on
> button2.
>
> Thanks
>
>



Nov 18 '05 #7
I have written a simple sub that 'turns' on and off the validators, until
..NET 2.0 comes out with validation groups ... that is my current work around
....

"Vladimir" <co***@ukr.ne t> wrote in message
news:OH******** ******@TK2MSFTN GP11.phx.gbl...
Look, you have to make all your validators in aspx code with
"Enabled"=False . In this case whatever button you click - no one will work. Than in some OnClick event handler you should write

private void SomeButton_OnCl ick (.......)
{
......
_MyValidator1.E nabled = true;
Page.Validate()
....
}

Run it in debug mode and be shure that your event is handled by this method and keep track of all steps. If your validator change it's state to enabled and then Page revalidates itself, all must work. And it do works 100%.

Regards,

Vladimir

"News" <ge**@lycos.com > wrote in message
news:gz******** *******@news04. bloor.is.net.ca ble.rogers.com. ..
Tried that, in the OnClick method but but it did not work, in what method
I
can set it?
blagodar'u Vladimir

"Vladimir" <co***@ukr.ne t> wrote in message
news:eX******** ******@TK2MSFTN GP12.phx.gbl...

... oh yes, and triger Page.Validate() method after that!
"Vladimir" <co***@ukr.ne t> wrote in message
news:u9******** ******@TK2MSFTN GP09.phx.gbl...
> Hi.
>
> It's extreamly easy to resolve this problem. Just set the Enabled property
> of all validators on the page to "False". Than modify it to "True"

in a > definite event handler only for validators that you want to be working. Thus
> others will stay disabled.
>
> Regards,
>
> Vladimir
>
> "News" <ge**@lycos.com > wrote in message
> news:eJ******** ************@ma gma.ca...
> > Hi,
> >
> > I have a page with one <form></form>.
> >
> > This page contains 2 part forms with 2 buttons, one for each part

form.
> >
> > <form>
> >
> > Part 1
> > <date>
> > <requiredfiledv alidator>
> > <button1 OnClick="btn1_O nClick" >
> >
> > Part 2
> > <name>
> > <address>
> > <button2 OnClick="btn2_O nClick">
> >
> > </form>
> >
> > Part 1 of the form has a required field with a date that must be field in
> > before clicking button1.
> >
> > Problem is when I click button2 required field validator from form

part
1
> > fires up.
> >
> > How can I disable required field validator from form part 1 when I

click
> on
> > button2.
> >
> > Thanks
> >
> >
>
>



Nov 18 '05 #8
In fact, there are several replacements to Microsoft's validators that offer
"validation groups" today. There are numerous limitations to Microsoft's
validators (like no client-side support for non-IE browsers) so many of
these replacements offer lots more features. I wrote one of them.
"Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx. Its 22 validators support validation
groups, "smart enabling" (when a validator should turn on and off based on
something else on the page), client-side support for IE, Netscape/Mozilla,
Opera 7, and Safari, and much more.

I wrote a document that helps you understand the limitations of Microsoft's
validators: http://www.peterblum.com/vam/valmain.aspx.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx
"News" <ge**@lycos.com > wrote in message
news:eJ******** ************@ma gma.ca...
Hi,

I have a page with one <form></form>.

This page contains 2 part forms with 2 buttons, one for each part form.

<form>

Part 1
<date>
<requiredfiledv alidator>
<button1 OnClick="btn1_O nClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_O nClick">

</form>

Part 1 of the form has a required field with a date that must be field in
before clicking button1.

Problem is when I click button2 required field validator from form part 1
fires up.

How can I disable required field validator from form part 1 when I click on button2.

Thanks

Nov 18 '05 #9

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

Similar topics

4
1642
by: Fox | last post by:
does anyone make a stylesheet for me? I don't have the time to learn how to do it and make it right now. any help appreciated
11
1787
by: Duane Lambe | last post by:
Hi folks - site's at http://www.datawire.net/files/intranet.html ; works fine in IE, but open in Firebird/Moz/Opera, and you can see that the word "Home" near the top doesn't move down to line up with Documentation on the left. I've tried seemingly every padding and margin I can think of, but can't get it to line up in browsers other than IE... little help once again. :) -- duane lambe
2
2536
by: Quansheng Liang | last post by:
Hello, I struggled with the problem of "undefined reference to `vtable ...`" while migrating a project from windows to linux. After searching the google I removed all the inline functions and now the link errors decreased from over 200 to 5. A great step! But one of my class derived from wxValidator can't be linked correctly though there is no any inline function in it. The error message: -----------------------
0
1255
by: Mike Kingscott | last post by:
Totally hacked off here. I've written a user control that contains a text box, a required field validator and a button (these being the cornerstone of a search facility), all as ASP.Net server controls. The user clicks the button, and server-side code does a redirect to a search page, appending the search expression to the URL. Great, I thought, let's move on. I then wrote an mailing list page which included the aforementioned user...
0
1634
by: TN Bella | last post by:
Hi, I am trying to get my compare validator to fire properly...Since I have panels the validator wouldn't work properly, the app would fire right but would insert the data regardless and the user couldn't fix an error if they had an error. So I added another sub and fixed the panels, but the compare validator still doesn't work right. Right now the validator pops up with the error that the two values (txtAcctAmtSum and txtInvAmt) are...
5
2934
by: Mattyw | last post by:
Hi, I'm relatively new to Web Forms, I have been using Required Field Validators and Regular Expression Validators on a Web Form I am developing and everything works as expected using Visual Studio.NET 2003 and VB code behind. I have a radio button and textbox, and basically i need the textbox to be required based on the user selecting "Yes" from the radio button. I've read through the newsgroups and found that a Custom Validator
2
4548
by: Mike Collins | last post by:
I have a form where I create dynamic controls at runtime. With this, I am adding a dynamic required field validator to each control as needed, but the validators are not firing when I click submit. The submit button was placed at design time and its causesvalidation property is set to true. Can someone tell me if something is missing from my code? Thank you. 1. Code to add dynamic control works fine and I get the Id of the textbox...
36
3132
by: aljamala | last post by:
Hi, I keep getting this warning on a page, but I do not know what the problem is...does anyone have an idea about what could be wrong? line 88 column 7 - Warning: missing </formbefore <td> it highlights this line: <form name="frmCurrency" action="" method="post"> Page source....
3
3545
by: Rich Squid | last post by:
Hello Here's my basic problem: On my asp.net form page I have a DetailsView (default mode=edit) bound to a AccessDataSource control. Users can successfuly update a databound template field, but I wanted to add a custom validator to check that the account number they are entering exists in a table in the Access Database.
1
1463
by: Cortney | last post by:
Hello, I need someone to take a look at http://www.matatransit.com please. The "Local Weather" box on right breaks the page layout and moves subsequent right column content to bottom of page in IE browsers. If I turn off CSS this is resolved, so I know it's the likely culprit. I have been unable to determine what specifically is causing the problem and just need some more eyes.
0
9961
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11180
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...
0
10778
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10885
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
10439
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...
1
7990
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5817
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6014
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3252
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.