Hi there!
I've ran into trouble with custom validation.
About two ears ago I've used the custom JS rule for two forms on one page and they worked.
Then I've migrated to V5 and as far I remember there was some troubles.
After few months I've retested the projected and was very upset, because the forms doesn't work and validate.
The situation:
1). There are two separate forms on one page
2). I've put
3). I've one common Load JavaScript event in the first form with the following code:
The code checks if the user types his name in allowed languages (En - default, Lt & Ru - additional languages)
So, now hitting the submit button (doesn't matter which form) twice the user see: 1). the error message from title property and hitting twice loads the success message!
Need help solving this
Thanks in advance!
I've ran into trouble with custom validation.
About two ears ago I've used the custom JS rule for two forms on one page and they worked.
Then I've migrated to V5 and as far I remember there was some troubles.
After few months I've retested the projected and was very upset, because the forms doesn't work and validate.
The situation:
1). There are two separate forms on one page
2). I've put
validate['required','%customCheck'] F
line in class tag's of each input field (two fields on one page)
3). I've one common Load JavaScript event in the first form with the following code:
function customCheck(el){
if (!el.value.test(/^[а-яА-ЯёЁa-zA-Z ąčęėįšųūžĄČĘĖĮŠŲŪŽ]+$/)) {
el.errors.push("Используйте только кириллические символы или латинские");
return false;
} else {
return true;
}
}
The code checks if the user types his name in allowed languages (En - default, Lt & Ru - additional languages)
So, now hitting the submit button (doesn't matter which form) twice the user see: 1). the error message from title property and hitting twice loads the success message!
Need help solving this
Thanks in advance!