473,473 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Create 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>
<requiredfiledvalidator>
<button1 OnClick="btn1_OnClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_OnClick">

</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 1210
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********************@magma.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>
<requiredfiledvalidator>
<button1 OnClick="btn1_OnClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_OnClick">

</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.net> wrote in message
news:ey**************@TK2MSFTNGP10.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********************@magma.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>
<requiredfiledvalidator>
<button1 OnClick="btn1_OnClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_OnClick">

</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********************@magma.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>
<requiredfiledvalidator>
<button1 OnClick="btn1_OnClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_OnClick">

</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.net> wrote in message
news:u9**************@TK2MSFTNGP09.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********************@magma.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>
<requiredfiledvalidator>
<button1 OnClick="btn1_OnClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_OnClick">

</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.net> wrote in message
news:eX**************@TK2MSFTNGP12.phx.gbl...

... oh yes, and triger Page.Validate() method after that!
"Vladimir" <co***@ukr.net> wrote in message
news:u9**************@TK2MSFTNGP09.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********************@magma.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>
<requiredfiledvalidator>
<button1 OnClick="btn1_OnClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_OnClick">

</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_OnClick (.......)
{
.......
_MyValidator1.Enabled = 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.cable.r ogers.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.net> wrote in message
news:eX**************@TK2MSFTNGP12.phx.gbl...

... oh yes, and triger Page.Validate() method after that!
"Vladimir" <co***@ukr.net> wrote in message
news:u9**************@TK2MSFTNGP09.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********************@magma.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>
> <requiredfiledvalidator>
> <button1 OnClick="btn1_OnClick" >
>
> Part 2
> <name>
> <address>
> <button2 OnClick="btn2_OnClick">
>
> </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.net> wrote in message
news:OH**************@TK2MSFTNGP11.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_OnClick (.......)
{
......
_MyValidator1.Enabled = 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.cable.r ogers.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.net> wrote in message
news:eX**************@TK2MSFTNGP12.phx.gbl...

... oh yes, and triger Page.Validate() method after that!
"Vladimir" <co***@ukr.net> wrote in message
news:u9**************@TK2MSFTNGP09.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********************@magma.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>
> > <requiredfiledvalidator>
> > <button1 OnClick="btn1_OnClick" >
> >
> > Part 2
> > <name>
> > <address>
> > <button2 OnClick="btn2_OnClick">
> >
> > </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.
"Professional 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****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"News" <ge**@lycos.com> wrote in message
news:eJ********************@magma.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>
<requiredfiledvalidator>
<button1 OnClick="btn1_OnClick" >

Part 2
<name>
<address>
<button2 OnClick="btn2_OnClick">

</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
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
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...
2
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...
0
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...
0
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...
5
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...
2
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....
36
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...
3
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,...
1
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...
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
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,...
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...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
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.