1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| function emailcheck(el)
{
var spinner = new Element('img',{
src:'move-spinner.gif',
styles : {
position : 'absolute'
},
opacity : 0
}
).inject(document.body);
var coords = el.getCoordinates(document.body);
var checked = "";
var url = "index2.php?option=com_user&format=raw&task=checkemail&email="+el.value;
var options = {
async : false,
onRequest : function()
{
alert(coords.right);
alert(coords.top);
spinner.setStyles({
left : coords.right+7,
top : coords.top+3
}
).fade('in');
},
onFailure : function(response) { alert('ERROR'); },
onSuccess : function(response)
{
spinner.hide();
checked = response;
}
};
var objRequest = new Ajax(url,options);
objRequest.request();
if(checked == "true")
return true;
else
{
el.errors.push("<?php echo utf8_encode("Cette adresse email est déjà utilisée."); ?>");
return false;
}
} |