The same id radio buttons dosent work on post form.

The same id radio buttons dosent work on post form.

Here is a script and its uses a latest jquery

  1. $(function() {
  2. $(".submit").click(function() {
  3.     var name = $("#name").val();
  4.     var surname = $("#surname").val();
  5.     var gender = $("#gender").val();
  6.     var birthyear = $("#birthyear").val();
  7.     var birthmonth = $("#birthmonth").val();
  8.     var birthday = $("#birthday").val();
  9.     var town = $("#town").val();
  10.     var country = $("#country").val();
  11.     var postalcode = $("#postalcode").val();
  12.     var dataString = 'name='+ name + '&surname=' + surname + '&gender=' + gender + '&birthyear=' + birthyear + '&birthmonth=' + birthmonth + '&birthday=' + birthday + '&town=' + town + '&country=' + country + '&postalcode=' + postalcode;
  13.     //alert (dataString);return false;
  14.               
  15.     if(name=='' || surname=='')
  16.     {
  17. $('html, body').animate({scrollTop:0}, 'slow');
  18. $('.notify-note').fadeOut(200).hide();
  19. $('.notify-error').fadeOut(200).show();
  20.     }
  21.     else
  22.     {
  23.     $.ajax({
  24.     type: "POST",
  25.     url: "settings.php",
  26.     data: dataString,
  27.     success: function(){
  28.     $('html, body').animate({scrollTop:0}, 'slow');
  29. $('.notify-note').fadeIn(200).show();
  30. $('.notify-error').fadeOut(200).hide();
  31.    }
  32. });
  33.     }
  34.     return false;
  35.     });
  36. });
To send a gender string i use

  1.           <INPUT type="radio" id="gender" name="gender" value="m">
  2.           <INPUT type="radio" id="gender" name="gender" value="f">
Its sends only a M value ..
The different IDs gives a undefined
there is a problem with radio button DOM - Jquery

Please help or fix :) Thanks