Click here to Skip to main content
15,903,663 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i am need small assistance that


how to get the textbox data in the javascript programming


and my sample code is


text: ghost.children(".ghost-content").html()+"--"+Some textbox  Content"



here in this line i need to get the some textbox content which was written so please give me a idea to get this

thanks q
Posted

following Javascript function gives you textbox data.
JavaScript
function getData()
{
 alert(document.getElementById("textBoxName").value)
}
 
Share this answer
 
v2
Comments
[no name] 30-Nov-11 5:17am    
can you say that how to call the javascript function using C#.net programming


thankq for your replay
try :
HTML
var text=document.getElementById('<%=txtbox1.ClientID%>').value;

first learn javscript basics and how to call js functions , have a look at the following , you may get some idea

http://msdn.microsoft.com/en-us/library/aa479011.aspx[^]

http://forums.asp.net/t/1117189.aspx/1[^]
 
Share this answer
 
v3
Use the following JavaScript Code :
JavaScript
var S = TextBoxName.Value();
alert(s);
 
Share this answer
 
document.getElementById("TextBoxID")
 
Share this answer
 
JavaScript
var textData=document.getElementById("yourTextBoxName").value;

if you are using JQuery

JavaScript
var textData=$("#yourTextBoxName").val();
 
Share this answer
 
JavaScript
function getData()
{
 alert(document.getElementById("textBoxName").value);
}

call above function from ASPX page. here is example
ASP.NET
<asp:button id="btnCall" text="call Me" onclientclick="return getData()" runat="server" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900