Created
November 14, 2012 16:23
-
-
Save deivisonarthur/4073097 to your computer and use it in GitHub Desktop.
unique-taxvat-parte01.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$('firstname').addClassName('unico'); | |
Validation.add('unico','Ja existe esse usuario cadastrado!',function(the_field_value){ | |
var url = '<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)?>unico/verifica.php?firstname=' + $('firstname').value; | |
var ok = false; | |
new Ajax.Request(url, { | |
method: 'get', | |
asynchronous: false, | |
onSuccess: function(transport) { | |
var obj = response = transport.responseText; | |
//alert (obj); | |
unico = obj.status_desc; | |
if (obj) { | |
Validation.get('unico').error = obj + ' ja usa esse login!'; | |
ok = false; | |
} else { | |
ok = true; | |
} | |
} | |
}); | |
return ok; | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment