0

I'm trying to store the radio buttons value in my local storage function if it is checked. Currently it is just storing the last value in the list, which is "3". Please see my fiddle: http://jsfiddle.net/3u7Xj/148/

Something like this?

if (!$(this).is(':radio') || this.checked) {
   $(this) = value;
   }
user3191137
  • 135
  • 3
  • 11
  • Well `$(this) = value` will give you an error: the left-hand side of an assignment has to be a variable. – nnnnnn Mar 24 '14 at 20:01

1 Answers1

1

I assume you mean the "oppcat" radio buttons. Here's how you could get the value of the radio button that is checked from the oppcat group:

Survey['oppcat'] = $('input[name=oppcat]:checked').val();

see also https://stackoverflow.com/a/596369/759610

Community
  • 1
  • 1
resnak
  • 43
  • 4