----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: Chintan Message 6 in Discussion run this code.. <HTML> <HEAD> <title>WebForm1</title> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" Content="C#"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body MS_POSITIONING="GridLayout"> <form runat="server" ID="Form1" method="post"> <asp:TextBox id="txtAddCoreID" runat="server" Width="184px"></asp:TextBox> <asp:CustomValidator ID="Custom1" ClientValidationFunction="checkName()" ControlToValidate="txtAddCoreId" runat="server"></asp:CustomValidator> <input name="Submit" value="Submit" type="button" onclick="checkName()"> </form> <Script language="JavaScript"> function checkName() { alert("Hi, the value entered in asp:TextBox is"+" "+ document.Form1.txtAddCoreID.value); return false; } </Script> </body> </HTML> ----- Original Message ----- From: DotNetSaavy (Mr.BabuRaj) To: BDOTNET Sent: Tuesday, November 16, 2004 12:46 PM Subject: How to pass asp:textbox value to a client side Javascript function ? New Message on BDOTNET How to pass asp:textbox value to a client side Javascript function ? Reply Reply to Sender Recommend Message 1 in Discussion From: DotNetSaavy (Mr.BabuRaj) Hi All, I have a form with the runat attribute set to server. I have three asp server controls on this form. 1) A textbox 2) A Custom validator 3) A command button I have set the ClientValidationFunction of the Customvalidator to "checkName() a client side javascript function" On clicking the command button, I want to pass the value of the ASP textbox to the client side javascript function and display the value in a alert box. How do I achieve this ? My aspx page has the following code ******************************************* <Script language="JavaScript"> function checkName() { alert('Hi, the value entered in asp:TextBox is'+); } </Script> <Form id="frmUsers" method="post" runat="server" > <asp:TextBox id="txtAddCoreID" runat="server" Width="184px"></asp:TextBox> <asp:CustomValidator ID="Custom1" ClientValidationFunction="checkName()" ControlToValidate="txtAddCoreId" runat="server"></asp:CustomValidator> <asp:button id="btnSubmit" runat="server" Text="Submit"></asp:button> </form> Thanks BabuRaj View other groups in this category. ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/BDotNet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
