B
B
Brase2016-09-21 14:54:18
Validation
Brase, 2016-09-21 14:54:18

Can't change form validation?

Hello.
There is validation on the site (Ukrainian).
Like this:
function feedback(vars) {
var bt = $(vars.form).find('.feedback');
var btc = bt clone();
varbvc = bt.val();
var cfg = conf[vars.act].cfg;
var indexTel = vars.data.indexOf('phone');
var index1 = vars.data.indexOf('_');
var index2 = vars.data.indexOf('38', indexTel);
if (((index1 != -1) && (index2 != -1)) || ((index1 == -1) && (index2 == -1))) {
$(vars.form).find(' input[name="phone"]:visible, textarea:visible, select:visible').css({'border': '2px solid #EE204D'}, 300).focus();
return false;
}
+ mask.
$(".phone").mask("+38(999)999-99-99", {autoclear: false});
});
The task is to change for Russia.
That is, in the mask, so that it is +7(999), etc.
I put +7 in the mask (without changing (('38', indexTel)) - form without validation)
Change ('7', indexTel) - does not send the form when it is completely filled. It just highlights all the numbers.
I understand this poorly, can someone tell me how to do the validation correctly.
So that if at least the 1st digit is not filled, the form would not be sent.
Here is the site: www.potolok5plus.ru
File: scripts/feedback.js

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question