How can I force jQuery Validate to check for duplicate username in database?

前端 未结 5 1093
春和景丽
春和景丽 2021-01-03 11:52

I\'m coming into the middle of this project so I\'m having to do a bit of re-writing because of sloppy code. I am using jQuery 1.6.1 and Validate 1.8.1.

First, here\

5条回答
  •  花落未央
    2021-01-03 12:07

    I faced the same problem, But I find the easiest solution just return true or false after encoding into json through php.

    if ($users->username_exists())
    {
        echo json_encode(FALSE);
    }else{
        echo json_encode(TRUE);
    }
    

提交回复
热议问题