function check_pm_debit(){
var ar_focus=new Array();
var error=0;
unhighlightField('payment_form');
if (isEmpty($F_("params_pm_debit_ks"))) {
ar_focus[ar_focus.length]="params_pm_debit_ks";
error=1;
}
if (isEmpty($F_("params_pm_debit_bik"))) {
ar_focus[ar_focus.length]="params_pm_debit_bik";
error=1;
}
if (isEmpty($F_("params_pm_debit_gend"))) {
ar_focus[ar_focus.length]="params_pm_debit_gend";
error=1;
}
if (isEmpty($F_("params_pm_debit_tele"))) {
ar_focus[ar_focus.length]="params_pm_debit_tele";
error=1;
}
if (error){
$_(ar_focus[0]).focus();
for (var i=0; i<ar_focus.length; i++ ){
highlightField(ar_focus[i]);
}
return false;
}
jQuery('#payment_form').submit();
}
Вот скрипт проверки заполненности поля и передача в форму.
Вот так 4 работает, а если добавить допустим
function check_pm_debit(){
var ar_focus=new Array();
var error=0;
unhighlightField('payment_form');
if (isEmpty($F_("params_pm_debit_ks"))) {
ar_focus[ar_focus.length]="params_pm_debit_ks";
error=1;
}
if (isEmpty($F_("params_pm_debit_bik"))) {
ar_focus[ar_focus.length]="params_pm_debit_bik";
error=1;
}
if (isEmpty($F_("params_pm_debit_gend"))) {
ar_focus[ar_focus.length]="params_pm_debit_gend";
error=1;
}
if (isEmpty($F_("params_pm_debit_gender"))) {
ar_focus[ar_focus.length]="params_pm_debit_gender";
error=1;
}
if (isEmpty($F_("params_pm_debit_tele"))) {
ar_focus[ar_focus.length]="params_pm_debit_tele";
error=1;
}
if (error){
$_(ar_focus[0]).focus();
for (var i=0; i<ar_focus.length; i++ ){
highlightField(ar_focus[i]);
}
return false;
}
jQuery('#payment_form').submit();
}
То уже ни одна проверка не срабатывает