Hi,
I have uses this plugin for the remote validation

Quote Originally Posted by jsakalos View Post
I've looked in my files and I've found that I do not use this plugin anymore but I use "ServerValidator". I do not have time now to make proper entries, links and demo in forum, anyway, try the following code - I'll post it proper way in a week, or so.

PHP Code:
// vim: ts=4:sw=4:nu:fdc=4:nospell
/*global Ext, console */
/**
 * @class Ext.ux.form.ServerValidator
 * @extends Ext.util.Observable
 *
 * Server-validates field value
 *
 * @author    Ing. Jozef Sakáloš
 * @copyright (c) 2008, by Ing. Jozef Sakáloš
 * @date      8. February 2008
 * @version   1.0
 * @revision  $Id: Ext.ux.form.ServerValidator.js 645 2009-03-24 02:35:56Z jozo $
 * 
 * @license Ext.ux.form.ServerValidator is licensed under the terms of
 * the Open Source LGPL 3.0 license.  Commercial use is permitted to the extent
 * that the code/component(s) do NOT become part of another Open Source or Commercially
 * licensed development library or toolkit without explicit permission.
 * 
 * <p>License details: <a href="http://www.gnu.org/licenses/lgpl.html"
 * target="_blank">http://www.gnu.org/licenses/lgpl.html</a></p>
 *
 * @donate
 * <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
 * <input type="hidden" name="cmd" value="_s-xclick">
 * <input type="hidden" name="hosted_button_id" value="3430419">
 * <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" 
 * border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
 * <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
 * </form>
 */

Ext.ns('Ext.ux.form');

/**
 * Creates new ServerValidator
 * @constructor
 * @param {Object} config A config object
 */
Ext.ux.form.ServerValidator = function(config) {
    
Ext.apply(thisconfig, {
         
url:'/request.php'
        
,method:'post'
        
,cmd:'validateField'
        
,paramNames:{
             
valid:'valid'
            
,reason:'reason'
        
}
        ,
validationDelay:500
        
,validationEvent:'keyup'
        
,logFailure:true
        
,logSuccess:true
    
});
    
Ext.ux.form.ServerValidator.superclass.constructor.apply(thisarguments);
}; 
// eo constructor

// extend
Ext.extend(Ext.ux.form.ServerValidatorExt.util.Observable, {

    
// {{{
    
init:function(field) {
        
this.field field;
        
// save original functions
        
var isValid field.isValid;
        var 
validate field.validate;

        
Ext.apply(field, {
            
// is field validated by server flag
             
serverValidundefined !== this.serverValid this.serverValid true
//             serverValid: true

             // private
            
,isValid:function(preventMark) {
                if(
this.disabled) {
                    return 
true;
                }
                return 
isValid.call(thispreventMark) && this.serverValid;
            }

            
// private
            
,validate:function() {
                var 
clientValid validate.call(this);

                
// return false if client validation failed
                
if(!this.disabled && !clientValid) {
                    return 
false;
                }

                
// return true if both client valid and server valid
                
if(this.disabled || (clientValid && this.serverValid)) {
                    
this.clearInvalid();
                    return 
true;
                }

                
// mark invalid and return false if server invalid
                
if(!this.serverValid) {
                    
this.markInvalid(this.reason);
                    return 
false;
                }

                return 
false;
            } 
// eo function validate

        
}); // eo apply

        // install listeners
        
this.field.on({
             
render:{single:truescope:thisfn:function() {
                
this.serverValidationTask = new Ext.util.DelayedTask(this.serverValidatethis);
                
this.field.el.on(this.validationEvent, function(e){
                    
this.field.serverValid false;
                    
this.filterServerValidation(e);
                }, 
this);
//                this.field.el.on({
//                    keyup:{scope:this, fn:function(e) {
//                        this.field.serverValid = false;
//                        this.filterServerValidation(e);
//                    }}
////                    ,blur:{scope:this, fn:function(e) {
////                        this.field.serverValid = false;
////                        this.filterServerValidation(e);
////                    }}
//                });
            
}}
        });
    } 
// eo function init
    // }}}
    
    
,serverValidate:function() {
        var 
options = {
             
url:this.url '?#' + (this.name || this.field.name)
            ,
method:this.method
            
,scope:this
            
,success:this.handleSuccess
            
,failure:this.handleFailure
            
,params:this.params || {}
        };
        
Ext.applyIf(options.params, {
             
cmd:this.cmd
            
,field:this.name || this.field.name
            
,value:this.field.getValue()
            ,
table:this.table
        
});
        
Ext.Ajax.request(options);
    } 
// eo function serverValidate

    // {{{
    
,filterServerValidation:function(e) {
        if(
this.field.value === this.field.getValue()) {
            
this.serverValidationTask.cancel();
            
this.field.serverValid true;
            return;
        }
        if(!
e.isNavKeyPress()) {
            
this.serverValidationTask.delay(this.validationDelay);
        }
    } 
// eo function filterServerValidation
    // }}}
    // {{{
    
,handleSuccess:function(responseoptions) {
        var 
o;
        try {
Ext.decode(response.responseText);}
        catch(
e) {
            if(
this.logFailure) {
                
this.log(response.responseText);
            }
        }
        if(
true !== o.success) {
            if(
this.logFailure) {
                
this.log(response.responseText);
            }
        }
        
this.field.serverValid true === o[this.paramNames.valid];
        
this.field.reason o[this.paramNames.reason];
        
this.field.validate();
    } 
// eo function handleSuccess
    // }}}
    // {{{
    
,handleFailure:function(responseoptions) {
        if(
this.logFailure) {
            
this.log(response.responseText);
        }
    } 
// eo function handleFailure
    // }}}
    // {{{
    
,log:function(msg) {
        if(
console && console.log) {
            
console.log(msg);
        }
    } 
// eo function log
    // }}}

}); 
Take a look also at docs: http://extjs.eu/docs/?class=Ext.ux.form.ServerValidator

This is my textfield:
Code:
                xtype:'textfield',
                fieldLabel: 'E-mail',
                name: 'email',
                vtype:'email',
                vtypeText: 'Inserisci un\'email valida',
                anchor:'95%',
                blankText:'Inserisci la tua <b>email</b>',
                msgTarget: 'under',
                allowBlank: false,
                plugins:[new Ext.ux.form.ServerValidator({
                    url:'valid/ins_email_check.php'
                } )]
                /*plugins:[Ext.ux.plugins.foServerValidator],
                rvOptions: {
                    url:'valid/ins_email_check.php'
                }*/
And this is some of my php code:

PHP Code:
    $post $_POST;

    
$field = @$post["field"];
    
$value = @$post["value"];

    
$o = new stdClass;
    
$o->success true;
    
$o->valid false;

        
$sql="
            SELECT nome
            FROM utents
            WHERE username='"
.$value."'
        "
;
        
$query=mysql_query($sql) or die("Errore SQL: ".mysql_error()."<br />".dbg_box($sql));
        if (!
mysql_num_rows($query)){
            
$o->valid true;
            unset(
$o->reason);
        }else
            
$o->reason "Username Exist";

    
header("Content-Type: application/json");
    echo 
json_encode($o); 
The problem is that if the username not exist into the table (condition without errors), it show the error's message "The value in this field is invalid".

If show the error's message present into "reason" (Username Exist), it show this message also when the username not exist.
Don't reset the reason?

I have upgrade the plugin but not the PHP code.

Into the PHP code change the sintax?

Thanks

Roberto.