Using JQuery AJAX to submit a form to PHP ,empty value -


i have script, submit not post value:

$(document).ready(function () {    $('#addproductform-<?php echo $row_ks['id']?>').validate({         rules: {             nguoilienhe: "required",             soluongphong: "required",             ngaynhanphong: "required",             ngaytraphong: "required",             email: {                email: true             },             songay: {                 required: true,                number: true             },             songuoi: {               required: true,                number: true             },             nguoilon: {                number: true             },             treem: {                 number: true             },             sodienthoai: {               required: true,                number: true             }                                                },                 messages: {                    nguoilienhe: "nhập tên người liên hệ",                     soluongphong: "nhập số lượng phòng đặt",                     ngaynhanphong: "chọn ngày nhận phòng",                     ngaytraphong: "chọn ngày trả phòng",                     email: {                            email: "nhập đúng định dạng mail"                         },                         songay: {                             required: "số ngày không được rỗng",                            number: "nhập kiểu số"                         },                     songuoi: {                           required: "nhập số người ở",                            number: "nhập kiểu số"                         },                         nguoilon: {                            number: "nhập kiểu số"                         },                         treem: {                            number: "nhập kiểu số"                         },                     sodienthoai: {                       required: "số điện thoại",                       number: "nhập kiểu số"                     }                 },         submithandler: function (form) {             // comment out ajax demo              $('#img_<?php echo $row_ks['id']?>').show();             var formdata = new formdata(this);             $.ajax({             url: 'booking.ajax',             type: 'post',             data: formdata,             async: false,             cache: false,             contenttype: false,             processdata: false,             success: function () {                 //alert('form submitted!');                  $('#img_<?php echo $row_ks['id']?>').hide();                 $('#addproductform-<?php echo $row_ks['id']?>')[0].reset();                  //console.log(formdata);                  $("#info-<?php echo $row_ks['id']?>").show();                 $("#info-<?php echo $row_ks['id']?>").delay(6000).fadeout();             },             error: function(){                 $("#error-<?php echo $row_ks['id']?>").show();                 $("#error-<?php echo $row_ks['id']?>").delay(6000).fadeout();             }         });             //alert('form submitted via ajax');             return false;          }     });  }); 

how submit post value


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -