|
-
Aug 22nd, 2005, 09:46 AM
#1
Thread Starter
Hyperactive Member
Form Validation
I'm currently stuck on what at first appeared to be a pretty straight forward problem.
I have an input form that captures a profile of a member (it's for a flying club)
On the form are check boxes where the member can indicate the types of license held and also textboxes for the the expiry date of these licenses or ratings.
I want to check that if a checkbox has been selected a date has been entered into the appropriate textbox.
I have a regular expression that validates the data entered into the Textbox, but no way of testing if it's been left empty.I don't wan't to make it a required field because it's only required if the associated checkbox has been selected.
In summary how do I test a textbox control for data based on the selection of a checkbox.
Hope this makes sense
-
Aug 22nd, 2005, 10:08 AM
#2
Re: Form Validation
Check the value of the checkbox. If the value is true, then check the textbox. If the value of the checkbox is true, and the textbox is empty, popup a messagebox or something indicating an entry must be made.
-
Aug 22nd, 2005, 11:39 AM
#3
Thread Starter
Hyperactive Member
Re: Form Validation
Thanks for the reply, could you expand a little please ?
Should I use a custom validate sub to check each control when the form is submitted, then pass it on for processing if all is ok ?
Sorry if I'm asking basic stuff I'm pretty new to asp.net
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|