473,493 Members | 2,245 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Required Field?

Hi,

Could someone give me a quick review of how to use the required field
Validator? I'm completely at a loss, and MSDN does not help one bit. =/
Basically all I want done is to make sure that the user enters some
text into a field called "txbName" and when they click on the submit
button, if they have not entered anything into the field, a Required
Field Validator will say "Invalid Name".

Thanks,
Kivak Wolf

Nov 19 '05 #1
3 2696
Kivak Wolf wrote:
Hi,

Could someone give me a quick review of how to use the required field
Validator? I'm completely at a loss, and MSDN does not help one bit. =/
Basically all I want done is to make sure that the user enters some
text into a field called "txbName" and when they click on the submit
button, if they have not entered anything into the field, a Required
Field Validator will say "Invalid Name".

Thanks,
Kivak Wolf


- Toss the validator on the page.
- Assign it's control to validate to your txtBox
- Give the validator an error messsage.
- I like to put a Validation Summary control on the page to centralize
the messages.
- compile, run.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #2
as simple as this:
<asp:requiredfieldvalidator id="ReqValtxbName" runat="server"
EnableClientScript="True" Display="Dynamic" ControlToValidate="txbName"
ErrorMessage="Invalid Name"></asp:requiredfieldvalidator>
"Kivak Wolf" <Li**********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Hi,

Could someone give me a quick review of how to use the required field
Validator? I'm completely at a loss, and MSDN does not help one bit. =/
Basically all I want done is to make sure that the user enters some
text into a field called "txbName" and when they click on the submit
button, if they have not entered anything into the field, a Required
Field Validator will say "Invalid Name".

Thanks,
Kivak Wolf

Nov 19 '05 #3
While I agree with the other answers, there is one more step. Always setup
server side validation because you cannot assume all browsers visiting your
site will run the client-side javascript supplied by Microsoft. In fact,
only IE and IE/Mac support their javascript in ASP.NET 1.x.

I've put together an article to educate users on validation. It discusses
setting up server side validation with examples and issues with client-side
validation. www.aspalliance.com/699.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Kivak Wolf" <Li**********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Hi,

Could someone give me a quick review of how to use the required field
Validator? I'm completely at a loss, and MSDN does not help one bit. =/
Basically all I want done is to make sure that the user enters some
text into a field called "txbName" and when they click on the submit
button, if they have not entered anything into the field, a Required
Field Validator will say "Invalid Name".

Thanks,
Kivak Wolf

Nov 19 '05 #4

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

Similar topics

5
2982
by: Lorenzo Bolognini | last post by:
Hi all, i need to detect whether a field is required or not. I'm using this code for building a string to convert later to an array (by Split) of which each element matches the field index (ex....
1
6446
by: Deborah V. Gardner | last post by:
I have a form frmViolations with a subform sfrmViolations. There is a one-to-many relationship between the two. On the subform I have a date field and a duration field. Both can be blank but if...
16
8446
by: Georges Heinesch | last post by:
Hi. My form contains a control (cboFooBar), which has an underlying field with the "Required" property set to "Yes". Now, while filling out all the controls of the form, I have to fill out this...
5
5619
by: Dave Brydon | last post by:
I'm checking for required fields, and using the code below, which I normally have no difficulties with; however, as a twist I decided to return the focus back to the specific field(s) in question...
2
39066
by: bufbec1 | last post by:
I am pretty good with Access, but do not understand VBA. I have researched this topic and see only VBA answers, so I hope someone can help with my specific question. I have 2 fields for an...
3
2919
by: Orchid | last post by:
Hello All, Hope someone can help me on my required field problems. I have a form base on a table for users to input new Employees. There are 4 fields that cannot be Null when entering new...
2
2336
by: pmud | last post by:
Hi, I have an ASP.Net web page . The page was working fine until I added a required field field validator. My page has a link button which takes the user to another page, a submit button which...
3
5313
by: CindyRob | last post by:
I am using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, with hotfix 82202, Visual studio .NET 2003 with hotfix 823639. I have generated a proxy class using wsdl.exe from a schema that has an...
7
8055
by: kiwipedia | last post by:
Hi all I have a combo-box control which I've set as a required field. It's a date and uses a calendar as coded below. All works fine unless the user deletes a pre-existing value (leaving a...
7
2568
by: samdev | last post by:
I have set up a table with a few fields that are set to required....all work fine except the fields that are Lookup from another table. What am I forgetting to set? Thanks!!
0
7119
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
7157
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
7195
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...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4889
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...
0
3088
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
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 ...
0
285
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...

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.