[RESOLVED] [2005] Required Field Validators
On my .aspx page, I have several required fields. When someone tries to submit the form without filling in a required field, that particular field is highlighted. Simple.
But what about after the user has entered a value? The box remains highlighted. I tried using some javascript to return the border color of the textbox back to normal, but I have no idea to make it look exactly as it did before it was highlighted. It's just the default border color, which appears to be a very thin light grey line around the text box, but I don't know the javascript bordercolor/borderwidth attributes needed to make it return to normal.
So, first and foremost, how do I get a field un-highlighted once the user inputs a value?
Re: [2005] Required Field Validators
How are you making the textbox highlighted in the first place? What is your RFV setup?
Re: [2005] Required Field Validators
Mendhak,
The rfv is setup with a forecolor of red.
Upon further inspection, the rfv may not be it after all. Are there any known issues with the validatorcalloutextender? I think that's the control that's actually highlighting the textbox, and the highlight color is being set via css.
Re: [2005] Required Field Validators
The ValidatorCalloutExtender does apply a 'highlight' to the textbox. Do you have a HighlightCssClass attribute set for the validator set?
Re: [2005] Required Field Validators
Is this what you mean?
highlightcssclass="validatorCalloutHighlight"
The thing that's throwing me for a loop is, the first name textbox loses it's highlight after a user enters a value, but all other textboxes remain highlighted in red.
Re: [2005] Required Field Validators
Yeah, that is what's causing the highlight. If you're looking to not highlight the textboxes, you can simply remove it.
Re: [2005] Required Field Validators
Mendhak,
Man, you will never guess what the problem was.
highlightcssclass="validatorCalloutHighlight " See that space between the last letter and the quotation mark? That was the problem. Only the validatorcallouthighlight for the txtFirstName text box has it without the space at the end.
That's one thing I always hated about programming. It's the little things that take all your time, only to figure out it was something simple.
So this is resolved, but I appreciate all your help Mendhak.
Re: [2005] Required Field Validators
Wow, I wouldn't have even guessed that myself. So nice work.