开发者

getting a radio button dynamically with jquery

I have tried this for too long... too big for me. I need a little help here. I have a page with p开发者_如何学编程roducts. each product got 3 sizes (normal, big, special) The user is selecting radio button to choose the size and then hits the "add to cart".

I am trying to get the value he chose, but without any success. Right now I found that jQuery is almost working for me.

If i write this down:

selected_val = $("input[name='sizeof75']:checked").val();

I am getting to right value of group named sizeof75. But since it changes dynamically, i am looking for a way to migrate the field name into this. I mean something like this:

selected_val = $("input[name='"+field_name+"']:checked").val();

any help will be aprreciated.

Thank you


Sorry,

this question is not relevant... just had a syntax problem...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜