[thelist] RE: asp.net: Why won't InitialValue work
Robert Vreeland
vreeland at studioframework.com
Wed Dec 22 20:43:47 CST 2004
ASP RegularExpressionValidator control will validate on the client if it is
an 'uplevel' browser - IE 5.5+, all other browsers will post back for
validation on the server.
Robert Vreeland
Managing Partner
StudioFramework
----- Original Message -----
From: "Timothy Kuhn (CW)" <tkuhn-cw at starbucks.com>
To: <thelist at lists.evolt.org>
Sent: Wednesday, December 22, 2004 1:48 PM
Subject: [thelist] RE: asp.net: Why won't InitialValue work
I think that you need to set the text property in the textbox to the
initial value also. Such as
<asp:textbox id="joined" runat="server" text="enter a value" />
<asp:RequiredFieldValidator initialValue="enter a value" id="rfvJoined"
ControlToValidate="joined"
ErrorMessage="Required: Enter Date: MM-DD-YYYY" Display="Dynamic"
runat="server" />
I didn't have time to test this but I do think it is correct.
------------------------------------------------------------------------
----
If I include InitialValue="MM-DD-YYYY" in the
RegularExpressionValidator,
nothing happens... it's like it's not even there. If I include it in
the
RequiredFieldValidator, it also does not display the initial value, AND
the
validator stops working and allows an empty value. What's with that?
How
can I make this work?
<form runat="server">
<asp:textbox id="joined" runat="server" />
<asp:RegularExpressionValidator id="revJoined"
ControlToValidate="joined"
ErrorMessage="Formt: Enter Date: MM-DD-YYYY" Display="Dynamic"
ValidationExpression="\d{2}-\d{2}-\d{4}" runat="server" />
<asp:RequiredFieldValidator id="rfvJoined" ControlToValidate="joined"
ErrorMessage="Required: Enter Date: MM-DD-YYYY" Display="Dynamic"
runat="server" />
</form>
--
* * Please support the community that supports you. * *
http://evolt.org/help_support_evolt/
For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !
More information about the thelist
mailing list