0

I need to deffer to kind of click events on radio button. The First is when some other radio button was checked, then necessarily radio button is checked. The second situation when necessarily radio button is checked, then user click on the same button again. I know how to get the value of the checked button:

$('input[name=group1]:checked').val()

But how to get the previous checked button value?

1
  • I'm a bit confused with your question. can you provide a fiddle? Commented Jun 8, 2012 at 9:59

1 Answer 1

1

The thing you can do is store value of previous click radio button value in some other field i.e hidden field and than make use of it or make use of cookie to store value or you can put it in a global variable..

Example of Hidden Field

<input type="hidden" value="" id="rdValue" />

when radio button click

  oldclickvalue = $("#rdValue").val();
  $("#rdValue").val( $('input[name=group1]:checked').val() );
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.