473,372 Members | 961 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,372 software developers and data experts.

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 1209
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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...

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.