How can I get the value of the selected radio button using JQuery or Prototype?
Here is my form:
<label for="deliveryChoice">Courier <b>£3.00</b></label>
<input type="radio" name="deliveryChoice" value="2.00" onchange="updateBasketTotals();" />
<label for="deliveryChoice">Royal Mail <b>£2.80</b></label>
<input type="radio" name="deliveryChoice" value="2.00" onchange="updateBasketTotals();" />
The last 2 commands I tried were:
deliveryVal = Form.getInputs('deliveryProcessor','radio','deliveryChoice').find(function(radio) { return radio.checked; }).value;
deliveryVal = jQuery('[name="deliveryChoice"]:radio:checked').val();
Any ideas?
Edit
The radio buttons are created as a result of an ajax call after page load. Here is a link to a jsfiddle with it: jsfiddle.net/4naqm
Something like this: