Here is the problem. lets say I have a product category table and a product table. by using foreach statement getting categories making them a html table and putting products inside the table as a radio group. so 3 product categories makes three different html table and inside the tablo i m listing the product as radio buttons.
when user selects an product i'm using jquery post statement and send some data. I'm using below jqeuery to understand which radio button selected.
$(document).ready(function () {
$("input[name='AD']:radio").change(function () {
var data = $("input[name='AD']:checked").val();
$.post("/Configure/UpdateAd/", { id: $(this).val() }, function (data) {
update($("#bottomRightA"), data);
});
});
});
And it works! but
here I have a problem. input[name='up']
I m using this way to differentiate radio groups based on category.
input type="radio" name="<%: model.CategoryName%> value="<%:model.CategoryId%>"
if I make all radio buttons name 'up', they become the same group as expected. and I cant tell the jquery which radio group is selected. Is there a way to use jquery with some kind of mvc nuggets?. Like below
input[name='" + <%: model.CategoryName + "']
or anything I can do with jQuery?
Thnx.