Click here to Skip to main content
15,917,456 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to insert data in text box which i have already created in a table in aspx file, so when i click button jquery function calls and there i want to insert data into textbox of table. how can i do that ?

What I have tried:

i have tried it like this as my textbox id = mesgbox 
  <pre>$("[id*=mesgbox ]").text("Hello World")
Posted
Updated 5-Apr-17 2:25am
Comments
Karthik_Mahalingam 5-Apr-17 8:05am    
Umer Farooq 5-Apr-17 8:09am    
yes i have try it with ajax but problem is textbox is in table and when i want to acccess its id by ("[id*=mesgbox ]") it doesnot gets maybe because it is enclosed it in table so how can i access id of textbox in a table and insert data in it?

Quote:
i want to acccess its id by ("[id*=mesgbox ]")


add inner quotes to it
$("[id*='mesgbox']") 

refer Attribute Contains Selector | jQuery API Documentation[^]
 
Share this answer
 
v2
i also tried it with this $('#subtotal').val(data); and it worked thanks
 
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