How can i check if an email already exists in DB

How can i check if details like username,email or uniq id number is not already in the database when registering a new user using dhtmlx forms or grid as a validation check??

I want this validation to be triggered onBlur

Hi

myForm.attachEvent(“onChange”, function(id,value){
if (id==“login”||id=“email”||…) {
dhtmlxAjax.post(“server.php?action=registerCheck”, id+"="+encodeURIComponent(value), function®{
// callback
alert(r.xmlDoc.responseText);
});
}
});

thank you andrei…how can i enable the same on the grid?

grid.attachEvent(“onEditCell”, function(state, id,…){
if state=2 that means edit finished, check our docs for details
})

so how do i return a value from the callback function above?

pelase privide details, not sure I understood what you want

Please write for me a function i can use as a form validation function named isEmailExists…pliiiiiz

Hi

please clarify your question - do you need function which will validate your email as default form validators do or do you need server-call and response check?

Yes…i want a server response that is boolean,so that in my form i can write something like
{item type:x validate:“isEmailExists”}

{type: “input”, …, validate: myFunc, …}

function myFunc(value) {
var r = dhtmlxAjax.postSync(“server.php”, “email=”+encodeURIComponent(value));
if (r.xmlDoc.responseText == “something”) {

} else {

}
return true/false;
}

Any where you can register first.So first to check the user name,e-mail id or unique id are valid or not.

You can check that with use of validation.
There are many types of validation.

Regular Expression- check the user name
Compare - to compare two password
Custom- attach a file
Range - specified a fix range