Thursday, July 10, 2014

jquery: checkbox & radiobutton related

Is checkbox checked:
 if ($('#order_use_billing').is(':checked')){

}

Wiring up event-handler to Radiobuttons & checking which one was selected:
$('[name=use_existing_billing_address]:radio').change(function(){
  if ($('[name=use_existing_billing_address]:checked').val() == 'yes') {
   
  }
  else {
 
  }
}

No comments:

Post a Comment

Followers

Blog Archive