具有序列化表单的Ajax,datepicker值

时间:2013-11-22 01:44:20

标签: php jquery ajax

当我将序列化表单数据发布到解析php文件时,我的日期字段不会发送。我使用了jquery的datepicker。当我做这样的普通帖子时:

            //Check for valid date format
        if (!dateFormat.test(birthDate)){
            self.config.birthdayError.addClass('erroroutput').text('Please enter a valid date: YYYY-DD-MM.');
            birthdayErr = true;
            return;
        } else {
            $.ajax({
                data: 'birthday=' + birthDate,
                success: function(result){
                    result = $.trim(result);

                    if (result == 'Too young.') ....

但是这段代码并没有发送生日:

//Post the data to PHP for varification and to add the user to the database.
postData: function(){
    var self = registerUser;

    console.log('Button clicked');
    console.log(self.config.signupform.serialize());
    //Send data to php for validation
    $.ajax({
        data: self.config.signupform.serialize(),
        // dataType: 'json',
        success: function(results){
            results = $.trim(results); 

console.log()清楚地显示了这一点。 return:first_name = dataEntered& last_name = dataEntered& username = dataEntered& password = dataEntered& retypepassword = dataEntered& email = dataEntered& forum_access = dataEntered& submitForm = Submit + Form

我知道如何跨过这座桥吗?

0 个答案:

没有答案