EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Anthony Artmann on March 25, 2013, 08:19:57 PM



Title: validatebox and remote
Post by: Anthony Artmann on March 25, 2013, 08:19:57 PM
I am trying to set up a validatebox that checks text input.  However, with my test code the validatebox never validates.  The test should return "true" if the user_name typed is "good".

Please advise.

Code below:

register.php
Code:
<input name="user_name" class="easyui-validatebox" data-options="required:true" validType="remote['validate_username.php', 'user_name']" invalidMessage="User name already exists.">
validate_username.php
Code:
<?php

                $user_name 
$_REQUEST['user_name'];
                if(
$user_name == 'good'){
                                echo 
'true'// successful input
                
}else{
                                echo 
'false';
                }

?>


Title: Re: validatebox and remote
Post by: Anthony Artmann on March 25, 2013, 08:51:35 PM
Sorry - I found the problem.  Wrong filename "validate_username.php" should have been "validate_user_name.php"...