html.radiobuttonlist

dynamic radiobutton in razor

那年仲夏 提交于 2019-12-24 06:49:01
问题 I am using razor view engine and having a bit of trouble creating a list of radiobutton . I am populating a table with a for loop with the values of my model in my view. at each row I want to have a radiobutton . I want to be able to select just one row and get the related items id from the model and submit it to another page. I know how to post. I actually achieved this by using checkbox . But the problem with checkbox is that it allows multiple selection. So I guess I need to use

How to get the selected value of the radio button list in jquery?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 16:11:57
问题 I have radio button list which has id as the value, I want to access the selected id in the jquery function. 回答1: If you have HTML that looks like this: <input type='radio' name='choices' value='1'> <input type='radio' name='choices' value='2'> <input type='radio' name='choices' value='3'> <input type='radio' name='choices' value='4'> <input type='radio' name='choices' value='5'> You would get the selected radio value with this: $("input:radio[name='choices']:checked").val(); 回答2: It will get

How to get the selected value of the radio button list in jquery?

左心房为你撑大大i 提交于 2019-11-27 21:50:37
I have radio button list which has id as the value, I want to access the selected id in the jquery function. Paolo Bergantino If you have HTML that looks like this: <input type='radio' name='choices' value='1'> <input type='radio' name='choices' value='2'> <input type='radio' name='choices' value='3'> <input type='radio' name='choices' value='4'> <input type='radio' name='choices' value='5'> You would get the selected radio value with this: $("input:radio[name='choices']:checked").val(); Ashish Babu It will get the selected value of the radiobutton at button click. ex for list $("#btn").click