Validation Question
-
Hi there, I've got 2 custom controls on a webform. Each custom control consists of a TextBox, a RequiredFieldValidator and a Button. The RequiredFieldValidators have ClientScript enabled but should only get fired when the matching button is clicked, that is: when the user hits ButtonA, the RequiredFieldValidatorA should validate TextboxA. Everything ending with a 'B' should be left alone. But by default, both RequiredFieldValidators display their messages. Can I avoid this? Thanks in advance! /matthias
I love deadlines. I like the whooshing sound they make as they fly by.
[Douglas Adams] -
Hi there, I've got 2 custom controls on a webform. Each custom control consists of a TextBox, a RequiredFieldValidator and a Button. The RequiredFieldValidators have ClientScript enabled but should only get fired when the matching button is clicked, that is: when the user hits ButtonA, the RequiredFieldValidatorA should validate TextboxA. Everything ending with a 'B' should be left alone. But by default, both RequiredFieldValidators display their messages. Can I avoid this? Thanks in advance! /matthias
I love deadlines. I like the whooshing sound they make as they fly by.
[Douglas Adams]Create a validator on the button that checks the text of the textbox. I reckon you'd have to write this yourself. Christian Graus - Microsoft MVP - C++
-
Hi there, I've got 2 custom controls on a webform. Each custom control consists of a TextBox, a RequiredFieldValidator and a Button. The RequiredFieldValidators have ClientScript enabled but should only get fired when the matching button is clicked, that is: when the user hits ButtonA, the RequiredFieldValidatorA should validate TextboxA. Everything ending with a 'B' should be left alone. But by default, both RequiredFieldValidators display their messages. Can I avoid this? Thanks in advance! /matthias
I love deadlines. I like the whooshing sound they make as they fly by.
[Douglas Adams]Hi Matthias, As the ASP.NET 1.x does not support the group of validators, so in addition to Christian's suggestion, you may try to enable/disable the validator depending on which button is clicked accordingly by setting the
enabled
property to true/false. However, this way seems to be a bit more complicated. -
Hi there, I've got 2 custom controls on a webform. Each custom control consists of a TextBox, a RequiredFieldValidator and a Button. The RequiredFieldValidators have ClientScript enabled but should only get fired when the matching button is clicked, that is: when the user hits ButtonA, the RequiredFieldValidatorA should validate TextboxA. Everything ending with a 'B' should be left alone. But by default, both RequiredFieldValidators display their messages. Can I avoid this? Thanks in advance! /matthias
I love deadlines. I like the whooshing sound they make as they fly by.
[Douglas Adams]Hi. I was facing the very same problem that you have. I could not find anyway of doing this, so I eventually decided to write my own validations, which are actually better, as I have more control and i can specify exactly what gets validated depending on user input.
-
Hi. I was facing the very same problem that you have. I could not find anyway of doing this, so I eventually decided to write my own validations, which are actually better, as I have more control and i can specify exactly what gets validated depending on user input.