Master Posted January 27, 2016 Report Share Posted January 27, 2016 How to get the value of the selected radio button? Quote Link to comment Share on other sites More sharing options...
0 bahar_vm Posted January 27, 2016 Report Share Posted January 27, 2016 Hi Master! To get the value of the selected radio button, you can use the 'checked' property in JavaScript. Here is a good reference in w3schools which explains it: http://www.w3schools.com/jsref/prop_radio_checked.asp Example: loop through the radio button options and get the value of the selected option. The following code works in a Submission form. For Update form or Details page, replace InsertRecord with EditRecord. FIELDNAME should be replaced with your field name (the radio button field). <script> var radios = document.getElementsByName("InsertRecordFIELDNAME"); for(i = 0; i < radios.length; i++) { if(radios[i].checked) { var selectedvalue = radios[i].value; } } </script> Quote Link to comment Share on other sites More sharing options...
Question
Master
How to get the value of the selected radio button?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.