A
Alan Silver
Hello,
I am using this validator on a textbox, and have discovered that if I
set the InitialValue property, then the validator correctly fires if the
user does not change the initial value of the textbox, but does NOT fire
if the textbox is empty!!
I thought the whole point of this validator was to ensure the control
being validated had some text. Am I doing something stupid? It looks
like I am going to need *two* validators for this, one to check for the
initial value and one to check there's something there. That's stupid,
no?
Here is some code...
<asp:TextBox ID="txtAddr1" Text="address" RunAt="server" />
<br><asp:RequiredFieldValidator ID="reqTxtAddr1"
ControlToValidate="txtAddr1" InitialValue="address" ErrorMessage=""
Text="Required" Display="Dynamic" RunAt="server"/>
TIA for any light you can shed on this.
I am using this validator on a textbox, and have discovered that if I
set the InitialValue property, then the validator correctly fires if the
user does not change the initial value of the textbox, but does NOT fire
if the textbox is empty!!
I thought the whole point of this validator was to ensure the control
being validated had some text. Am I doing something stupid? It looks
like I am going to need *two* validators for this, one to check for the
initial value and one to check there's something there. That's stupid,
no?
Here is some code...
<asp:TextBox ID="txtAddr1" Text="address" RunAt="server" />
<br><asp:RequiredFieldValidator ID="reqTxtAddr1"
ControlToValidate="txtAddr1" InitialValue="address" ErrorMessage=""
Text="Required" Display="Dynamic" RunAt="server"/>
TIA for any light you can shed on this.