[PHP]Hilfe mit JQuery und Button Senden

03/04/2014 23:16 turk55#16
Why are you guys doing so hard with hardcoding the post values ?

Code:
$('#registerForm').on("submit", function(event){ 
    event.preventDefault();
    $.ajax({
        type: 'POST',
        url: '/includes/register.php',
        data: $("#registerForm").serialize()
    }).done(function(response) {
        $('#response').html(response);
    }); 
});
using serialize() you can send the whole form.
03/04/2014 23:42 EqoTime#17
Quote:
Originally Posted by turk55 View Post
Why are you guys doing so hard with hardcoding the post values ?

Code:
$('#registerForm').on("submit", function(event){ 
    event.preventDefault();
    $.ajax({
        type: 'POST',
        url: '/includes/register.php',
        data: $("#registerForm").serialize()
    }).done(function(response) {
        $('#response').html(response);
    }); 
});
using serialize() you can send the whole form.

Thx. Sagol kardes.