Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 22nd, 2005, 03:38 PM
Authorized User
 
Join Date: Jul 2005
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default RequiredFieldValidator

Anybody successfully get the InitialValue working?

<asp:TextBox id="myCtrl" runat="server" Text="" CausesValidation=true />
<asp:RequiredFieldValidator id="reqd1" runat="server"
ControlToValidate="myCtrl" InitialValue="Please Enter"> Nothing
</asp:RequiredFieldValidator>

The initial value dosn't show up. Anybody?

 
Old December 22nd, 2005, 06:23 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The InitialValue isn't meant to "show up". It's used to compare the initial value of the text box so it knows what to compare against.

If the text box still has Please Enter, then the validator control will be invalid.

So, add "Please Enter" as the Text property of the TextBox and it'll work.

For more details: http://msdn.microsoft.com/library/de...valuetopic.asp

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
RequiredFieldValidator Control bnorg ASP.NET 1.0 and 1.1 Basics 1 May 3rd, 2006 04:44 PM
RequiredFieldValidator bnorg ASP.NET 1.0 and 1.1 Basics 3 April 24th, 2006 10:00 PM
RequiredFieldValidator GuyB ASP.NET 1.0 and 1.1 Basics 1 November 23rd, 2005 03:11 PM
requiredfieldvalidator suzila ASP.NET 1.0 and 1.1 Basics 5 January 9th, 2004 08:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.