PDA

Click to See Complete Forum and Search --> : Best way to notify of a required field???


token
Jan 13th, 2005, 10:01 AM
I need some help.

I want to have some validation in my form, so that when a user submits the form it will alert them if they miss a required field.

I am aware of the RequiredFieldValidator, but that takes up space on my form, and pushes it all around making it look terrible.

I want to know what would be a better way of handling it but not too sure if any of these ideas will work, or how to implement properly.

Could i have code in the code-behind of the submit button that verifies each field and then have a Javascript alert box popup to tell them they have a missing field and then cancel the submit. If so how do I call the javascript from the code-behind.

Or should I just capture all missing fields, building a string which after if there are any errors, take them to another form displaying what errors were encountered on their submission, and get them to hit the 'back' button to go back to the form to correct their problems.

Thanks.

EricDalnas
Jan 13th, 2005, 11:09 AM
all I usually do is use the required field validator but make it only large enough for an asterisk next to the field. And then I put a validation summary control at the top of the form.

token
Jan 13th, 2005, 01:51 PM
Could you tell me how you made the validation smaller, because for me the error message seems to determine the size of the requiredFieldValidation control.