Click here to Skip to main content
15,908,581 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have get the value of the textbox with jquery in asp.net plz help
Posted
Comments
Sanket Saxena 6-May-14 6:33am    
Post your HTML

JavaScript
$(document).ready(function()
     {
     $('#<%=btn.ClientID%>').click(function()
     {
 var total = (parseInt($('#<%= txtamt.ClientID %>').val());
 $('#<%=lblshow.ClientID%>').val(total);  
 });
     });
 
Share this answer
 
v2
Comments
Sanket Saxena 6-May-14 6:37am    
I think OP is newbie your example is quite tough for him....just <br>
var total = $('#<%= txtamt.ClientID %>').val(); is enough right king?
King Fisher 6-May-14 6:45am    
hi :),
i just mentioned with Event .OP is Newbie so, i think he will again ask for the event .that's why ;)
Sanket Saxena 6-May-14 6:48am    
sure he will ask if he use the click event :)
King Fisher 6-May-14 6:51am    
:)
Always post your code we dont know how your HTML is. Well says your textbox id is "txtEmail". Then just use the below code to get the textbox value.
JavaScript
$(document).ready(function(){
  var email = $("#txtEmail").val();
});


if using masterpage and your textbox is in content page then:
JavaScript
$(document).ready(function(){
  var email = $('#<%=txtEmail.ClientID %>').val();
});
 
Share this answer
 
v3
JQUERY:

var eventText = document.getElementById('<%=Textbox1.ClientID%>').value;

C#:(SERVER SIDE)

string strValue= Textbox1.Text;
 
Share this answer
 
Comments
Sanket Saxena 6-May-14 6:40am    
document.getElementById is jQuery?????

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