99 views

Проверка формы за заполнение данных

var form = $(this).parents('form'),
			params = [
				$(form).find('[name="REGISTER[NAME]"]'),
				$(form).find('[name="REGISTER[PERSONAL_PHONE]"]')
			],
			i = params.length,
			error = false;

		while (i--) {
			if ($(params[i]).val() == '') {
				error = true;
				$(params[i]).addClass('error');
			} else {
				$(params[i]).removeClass('error');
			}
		}
		console.log(error);

		if (error) {
			return false;
		}
This site is using the Seo Wizard wordpress plugin by www.seowizard.org.