how to set value to textbox inside an html table

Posted by Klbaiju under jQuery on 6/18/2015 | Points: 10 | Views : 1045 | Status : [Member] | Replies : 1
Hi all,

in my application, i want to set the value of textbox inside html table.

following is my code

var m = 1;
for (m; m <= cnt; m++) {
$("#grdtable").find("tr").eq(m).find("td").eq(1).text(data.d[m - 1].Vlnaccount);
//$("#grdtable").find("tr").eq(m).find("td").eq(1).$('input[type = text]').val(data.d[m - 1].Vlnaccount);
}

the above working but it is not setting the value to textbox.,but it set the value to td.and textbox is not showing.

my requirement is to set value inside textbox .

how to solve it.

Regards

Baiju




Responses

Posted by: Sheonarayan on: 6/18/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Difficult to answer unless you write the complete hierarchy of the html table. In general you can use different selectors available in jQuery. As all the textbox id must have a pattern so you can use element value selectors. Read about selectors at http://techfunda.com/Howto/jquery/selectors.

Hope this helps.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response