$('tr').each(function(i, el) {
var query = $(el).children('td').children('.query').text();--How to get textbox value
var text = $(el).children('td').children('.text').text();
alert(query + " " + text);
//$.ajax (do your AJAX call here using values of query and text
});
});
Member
37 Points
111 Posts
get table row value using ajax
Dec 19, 2013 12:42 AM|ShriNaveen|LINK
hi,
i want to get table row value
this is my coding but cant get table value
<table>
<tr>
<td class="editable"> <a class="query" href="#"> <input type='text' name='postcode' id='txt_Address1' value=''/> </a> </td>
<td class="editable"> <a class="text" href="#"><input type='text' name='postcode' id='txt_Address2' value=''/> </a> </td>
</tr>
</table>
<input type="button" id="detect_rel" value="detect"/>
$('#detect_rel').click(function() {
$('tr').each(function(i, el) {
var query = $(el).children('td').children('.query').text();--How to get textbox value
var text = $(el).children('td').children('.text').text();
alert(query + " " + text);
//$.ajax (do your AJAX call here using values of query and text
});
});
thanks
thanks
All-Star
31362 Points
7055 Posts
Re: get table row value using ajax
Dec 19, 2013 01:00 AM|kaushalparik27|LINK
Check out below working example that mathes some of your requirement. You can modify it to get <a> value as well:
hope it helps/.
[KaushaL] Blog Twitter [MS MVP 2008 & 2009] [MCC 2011] [MVP Reconnect 2017]
Don't forget to click "Mark as Answer" on the post that helped you
Member
37 Points
111 Posts
Re: get table row value using ajax
Dec 19, 2013 01:25 AM|ShriNaveen|LINK
Hi,
m creating dynamically textbox ,
how to get that textbox value without mention textboxid
<tr>
<td class="editable"> <a class="query" href="#"> <input type='text' name='postcode' id='txt_Address1' value=''/> </a> </td>
<td class="editable"> <a class="text" href="#"> <input type='text' name='postcode' id='txt_Address1' value=''/> </a> </td>
</tr>
<tr>
<td class="editable"> <a class="query" href="#"> <input type='text' name='postcode' id='txt_Address1' value=''/> </a> </td>
</tr>
<tr>
<td class="editable"> <a class="query" href="#"> <input type='text' name='postcode' id='txt_Address1' value=''/> </a> </td>
</tr>
<tr>
<td class="editable"> <a class="query" href="#"> <input type='text' name='postcode' id='txt_Address1' value=''/> </a> </td>
</tr>
</tr>
thanks
All-Star
31362 Points
7055 Posts
Re: get table row value using ajax
Dec 19, 2013 01:31 AM|kaushalparik27|LINK
You can get it by specifying the type='text' in selector. Here is the example without using ID:
hope it helps./.
[KaushaL] Blog Twitter [MS MVP 2008 & 2009] [MCC 2011] [MVP Reconnect 2017]
Don't forget to click "Mark as Answer" on the post that helped you