POST request data is sent to the processor

<script> function setup <? echo$user['id']; ?> () { $.post("pages/setup.php", { login_user: $("#login_user").val(), email_user: $("#email_user").val(), telefon_user: $("#telefon_user").val(), pass: $("#pass").val(), password: $("#password").val(), password2: $("#password2").val(), money_account_mode: $("#money_account_mode input:radio").val(), wmr_user: $("#wmr_user").val(), wmz_user: $("#wmz_user").val(), qiwi_user: $("#qiwi_user").val(), bik_user: $("#bik_user").val(), namebank_user: $("#namebank_user").val(), fio_user: $("#fio_user").val(), karta_user: $("#karta_user").val() }, function (data) { if (data != "ok") { $("#error_error").html("<div class=\"alert alert-error\"><a class=\"close\" data-dismiss=\"alert\" href=\"#\">×</a>" + data + "</div>"); } else { $("#setup_forma").hide(); $("#error_error").html("<div class=\"alert alert-info\">Настройки успешно изменены!</div>"); } }); } </script> 

The value of the radio buttons is not recorded in the database.

 echo '<div class="radio"> <label> <input type="radio" name="money_account_mode" id="money_account_mode" value="мобильный телефон" class="registration_form-check registration_form-check-first" checked />Мобильного телефона</label> </div> <div class="radio"> <label> <input type="radio" name="money_account_mode" id="money_account_mode" value="qiwi" class="registration_form-check" />qiwi</label> </div>'; 

We have a mistake here


 money_account_mode: $("#money_account_mode input:radio").val() 
  • 2
    Doesn't anyone bother anyone that at least there are at least two elements with the same id? and please specify the essence of the error, is not recorded in the database, or are the wrong values ​​sent? - FLK
  • Due to the fact that 2 id and does not work? Somehow did not pay attention))) - vitagame
  • one
    if the code contains the same id then js always uses only the first one when sampling - FLK
  • one
    @vitagame,> Somehow I didn’t pay attention strangely somehow ... What would have happened if people hadn’t paid attention to the fact that the bleznyaschek were also called the same name. )) - Deonis
  • In one field of the table you need to write one of the selected values. - vitagame 4:39 pm

0