// fix on front validators
This commit is contained in:
@@ -22,14 +22,12 @@
|
|||||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*/
|
*/
|
||||||
$(document).ready(function() {
|
$(document).on('keyup', 'input.validate, textarea.validate', function() {
|
||||||
$('input.validate, textarea.validate').on('keyup', function() {
|
if ($(this).hasClass('is_required') || $(this).val().length)
|
||||||
if ($(this).hasClass('is_required') || $(this).val().length)
|
{
|
||||||
{
|
if (window['validate_'+$(this).attr('data-validate')]($(this).val()))
|
||||||
if (window['validate_'+$(this).attr('data-validate')]($(this).val()))
|
$(this).parent().removeClass('form-error').addClass('form-ok');
|
||||||
$(this).parent().removeClass('form-error').addClass('form-ok');
|
else
|
||||||
else
|
$(this).parent().addClass('form-error').removeClass('form-ok');
|
||||||
$(this).parent().addClass('form-error').removeClass('form-ok');
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user