473,379 Members | 1,257 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,379 software developers and data experts.

RequiredFieldValidator

I have an ASP.NET page with various textboxes, checkboxes and a date picker.
Attached to some of these controls i have RequiredFieldValidator. One of the
textboxes has a button next to it. When clicking a calender object is
opening and allows the user to select a date. When clicking that button the
RequiredFieldValidators triggers. So i added some code to the calender
button event :
RequiredFieldValidator2.Enabled = false;
RequiredFieldValidator1.Enabled = false;

But this is no good since validation is clientside. Is there a way i can
solve this? In other words toggle on and off validators in code so that they
dont trigger before the submit button is clicked

Best regards
Trond
Nov 17 '05 #1
3 5115
In asp.net you can use the validationgroup property for validators (or set
CausesValidation property of the button to false). This will solve your
problem.
Why not using an image or link instead of a button for the calendar?

Hope this helps,
Arjen
"Trond" <tr***@montanis.com> schreef in bericht
news:OF**************@TK2MSFTNGP10.phx.gbl...
I have an ASP.NET page with various textboxes, checkboxes and a date
picker. Attached to some of these controls i have RequiredFieldValidator.
One of the textboxes has a button next to it. When clicking a calender
object is opening and allows the user to select a date. When clicking that
button the RequiredFieldValidators triggers. So i added some code to the
calender button event :
RequiredFieldValidator2.Enabled = false;
RequiredFieldValidator1.Enabled = false;

But this is no good since validation is clientside. Is there a way i can
solve this? In other words toggle on and off validators in code so that
they dont trigger before the submit button is clicked

Best regards
Trond

Nov 17 '05 #2
....asp.net... in asp.net 2.0


"Arjen" <bo*****@hotmail.com> schreef in bericht
news:de**********@news2.zwoll1.ov.home.nl...
In asp.net you can use the validationgroup property for validators (or set
CausesValidation property of the button to false). This will solve your
problem.
Why not using an image or link instead of a button for the calendar?

Hope this helps,
Arjen
"Trond" <tr***@montanis.com> schreef in bericht
news:OF**************@TK2MSFTNGP10.phx.gbl...
I have an ASP.NET page with various textboxes, checkboxes and a date
picker. Attached to some of these controls i have RequiredFieldValidator.
One of the textboxes has a button next to it. When clicking a calender
object is opening and allows the user to select a date. When clicking that
button the RequiredFieldValidators triggers. So i added some code to the
calender button event :
RequiredFieldValidator2.Enabled = false;
RequiredFieldValidator1.Enabled = false;

But this is no good since validation is clientside. Is there a way i can
solve this? In other words toggle on and off validators in code so that
they dont trigger before the submit button is clicked

Best regards
Trond


Nov 17 '05 #3
Thank you. Sometimes the solution to problems are so simple, but so hard to
find :-)
Best regards
Trond

"Arjen" <bo*****@hotmail.com> wrote in message
news:de**********@news2.zwoll1.ov.home.nl...
...asp.net... in asp.net 2.0


"Arjen" <bo*****@hotmail.com> schreef in bericht
news:de**********@news2.zwoll1.ov.home.nl...
In asp.net you can use the validationgroup property for validators (or
set CausesValidation property of the button to false). This will solve
your problem.
Why not using an image or link instead of a button for the calendar?

Hope this helps,
Arjen
"Trond" <tr***@montanis.com> schreef in bericht
news:OF**************@TK2MSFTNGP10.phx.gbl...
I have an ASP.NET page with various textboxes, checkboxes and a date
picker. Attached to some of these controls i have RequiredFieldValidator.
One of the textboxes has a button next to it. When clicking a calender
object is opening and allows the user to select a date. When clicking
that button the RequiredFieldValidators triggers. So i added some code to
the calender button event :
RequiredFieldValidator2.Enabled = false;
RequiredFieldValidator1.Enabled = false;

But this is no good since validation is clientside. Is there a way i can
solve this? In other words toggle on and off validators in code so that
they dont trigger before the submit button is clicked

Best regards
Trond



Nov 17 '05 #4

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

Similar topics

6
by: BK | last post by:
I'm having a really strange problem with and HtmlSelect server control (listbox) and a RequiredFieldValidator that I am trying to use to make sure that someone has items in the listbox. The way...
0
by: Nicolas | last post by:
How can I have only one RequiredFieldValidator to control two TextBox webcontrols so that only one message is displayed <asp:Label id="lbl_UserName" runat="server"></asp:Label><br> <asp:TextBox...
3
by: me | last post by:
Is there any particular reason why a requiredfieldvalidator cant validate a listbox? I have bound the two together but the validator always returns false on isvalid and so does the Page, no matter...
7
by: Ed West | last post by:
Hello, I have a simple form with some input boxes. After validation if one fails, then I would like to at the top of the page say something like "The following fields in red are required" and...
4
by: James | last post by:
Hello, I have a RequiredFieldValidator for several textbox controls on a form. Here's an example with the RequiredFieldValidator. EnableClientScript, Enabled, and Visible are set to true for...
4
by: Joe | last post by:
Hello, I have created a login page using dotnet. I am using requiredFieldValidator and noticed that the code works fine in IE but not in Netscape, Opera, Mozilla, Firefox, etc. For example...
5
by: Fernando Lopes | last post by:
Hi. I want to show an image in a requiredfield validator instead of "*". So, I 'm set the requiredfieldvalidator attributes like following: <asp:RequiredFieldValidator id=rfvFirstName...
2
by: Hongbo | last post by:
Hi, I have a Asp.Net written in C#. It serve as information input form. The form encounters sort of random problem with the email field and state field. I have validator attached with these 2...
1
by: Giovanni | last post by:
Dear Friends, I need your help. I am trying to dynamically create a RequiredFieldValidator in the ItemCreated event of a DataList but cannot get it to work. The errors seem to revolve around...
2
by: Christina | last post by:
Hello !! I am creating a dynamic textbox and want to validate it using the requiredfieldvalidator. These are the steps which I tried: ==================================================== 1)...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.