Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Required Field Validator and Drop Down list 1

Status
Not open for further replies.

xcaliber2222

Programmer
Apr 10, 2008
70
US
Hello,

I know how to implement a RFV for a DDL, but I have 11 drop down lists and 1 TextBox. One of these 12 controls must have a value before submit. Is there any way to insure that the user will have to select one of the 11 drop downs or TextBox? I've tried client side validation using a JavaScript onsubmit function (using Value, SelectedItem.Value, SelectedIndex == 0, etc.). Nothing is working with client-side validation so now I'm thinking the best way to go is with the .NET required field validation, but I cannot seem to be able to figure out how to implement this for any one of the 12 controls.

Any help greatly appreciated.

Thanks,
Alejandro

 
a required field validator validates a single control has a value. in your case you want to validate 1 of 12 drop downs has a value or a textbox has a value. for that you want a customfieldvalidator. drop this on the page and then add a handler for server validate event. in this event check the 12 dropdowns and the textbox for a value.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top