![]() |
Display message when RequiredFieldValidator fired
Hello,
I have a form with 5 textbox for each one a RequiredFieldValidator I show (*) if the field is missing when I post the form. I'd like when a least one of theses RequiredFieldValidator fired display an another message (other then ErrorMessage). Is there a way to do that ? Thanks, |
Re: Display message when RequiredFieldValidator fired
Which is it, you want an asterisk or a message, it can't be both.
"Christian Ista" <ml@cista.be> wrote in message news:ubduik92EHA.2012@TK2MSFTNGP15.phx.gbl... > Hello, > > I have a form with 5 textbox for each one a RequiredFieldValidator I show > (*) if the field is missing when I post the form. > > I'd like when a least one of theses RequiredFieldValidator fired display > an another message (other then ErrorMessage). Is there a way to do that ? > > Thanks, > |
Re: Display message when RequiredFieldValidator fired
I suggest you display the asterisk next to all the required fields to begin
with in order to "pre-indicate" which fields are required. That's common practice these days. Ray at work "Christian Ista" <ml@cista.be> wrote in message news:ubduik92EHA.2012@TK2MSFTNGP15.phx.gbl... > Hello, > > I have a form with 5 textbox for each one a RequiredFieldValidator I show > (*) if the field is missing when I post the form. > > I'd like when a least one of theses RequiredFieldValidator fired display an > another message (other then ErrorMessage). Is there a way to do that ? > > Thanks, > > |
Re: Display message when RequiredFieldValidator fired
> Which is it, you want an asterisk or a message, it can't be both. That's the point, I'd like both. An asterisk is displayed next to the field and I'd like an another comment in an another location. Thanks, |
Re: Display message when RequiredFieldValidator fired
Set the text (between the <> and </>) to * and the Error message to "blah".
Then drop on the summary and on the validator set the Display=Static -- Curt Christianson Owner/Lead Developer, DF-Software Site: http://www.Darkfalz.com Blog: http://blog.Darkfalz.com "Christian Ista" <ml@cista.be> wrote in message news:O57pc$92EHA.1564@TK2MSFTNGP09.phx.gbl... > >> Which is it, you want an asterisk or a message, it can't be both. > > That's the point, I'd like both. > > An asterisk is displayed next to the field and I'd like an another comment > in an another location. > > Thanks, > |
Re: Display message when RequiredFieldValidator fired
So, you'd like to have an * next to the textbox, but a more helpful error
message somewhere else? That can be accomplished. The RequiredFieldValidator (as well as the other Validation controls) have two properties you should be interested in. The first is the ErrorMessage property, and the second is the Text property. Set the ErrorMessage property to "This field is required", and the Text property to "*". Then, add a ValidationSummary control to the top of your form. If validation errors occur, the Text property ("*") will be the one displayed next to the TextBox, while the ErrorMessage property will be the one displayed in the ValidationSummary control. Hope this helps, Johann MacDonagh "Christian Ista" <ml@cista.be> wrote in message news:ubduik92EHA.2012@TK2MSFTNGP15.phx.gbl... > Hello, > > I have a form with 5 textbox for each one a RequiredFieldValidator I show > (*) if the field is missing when I post the form. > > I'd like when a least one of theses RequiredFieldValidator fired display > an another message (other then ErrorMessage). Is there a way to do that ? > > Thanks, > |
| All times are GMT. The time now is 01:46 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.