Advertisement
Guest User

get radio button value

a guest
Nov 20th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. add_action( 'wp_head', function () { ?>
  2. <script>
  3.  
  4. jQuery(document).ready(function() {
  5. var resident_input = jQuery('input[name="wa_resident_yes_no"]')
  6. resident_input.change(function(){
  7. var checked = resident_input.filter(':checked');
  8. var checked_val = checked.val();
  9. console.log(checked_val) ;
  10. jQuery.ajax({
  11. type: 'post',
  12. url: '' ,
  13. data: {resident : checked_val},
  14. success: function(data){
  15. console.log("success!");
  16. //console.log(data);
  17. }
  18. });
  19. }) ;
  20.  
  21. });
  22.  
  23.  
  24. </script>
  25. <?php });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement