Hi Experts..
I want to assign a value stored in a javascript variable to an asp:textbox control.
I tried this but its not working.
The value property is not coming.Please help me out..
document.getElementById('<%=txtEmail%>').value
Hi Experts..
I want to assign a value stored in a javascript variable to an asp:textbox control.
I tried this but its not working.
The value property is not coming.Please help me out..
document.getElementById('<%=txtEmail%>').value
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Dec 10, 2011, 4:43 PM
Shivaraj PoojaryPosted Dec 10, 2011, 6:13 AM
Mayur GujrathiPosted Dec 10, 2011, 5:50 AM
In javascript write this
Satyapriya NayakPosted Dec 10, 2011, 5:47 AM
Another way of doing it.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Get_value_Textbox_javascript._Default" %>
Thanks
If this post helps you mark it as answer
Satyapriya NayakPosted Dec 10, 2011, 5:36 AM
Try this...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Get_value_Textbox_javascript._Default" %>
Thanks
If this post helps you mark it as answer
Shivaraj PoojaryPosted Dec 10, 2011, 5:24 AM
Pankaj RanaPosted Dec 10, 2011, 5:07 AM
Try this document.getElementById('<%=txtEmail.ClientID%>').value
hope this will work in code.