Hi need help to change this JS
function doSubmit(f, v){
if ( v ){
var a = new Array();
a[a.length] = [f.Name, 'Fullname'];
a[a.length] = [f.i_UserTel, 'Phone', ['number',null, null]];
a[a.length] = [f.i_OtherLocation, 'Place'];
a[a.length] = [f.i_description, 'Description'];
a[a.length] = [f.i_action, 'Action.'];
a[a.length] = [f.i_totalcost, 'Total cost'];
a[a.length] = [f.i_police_report, 'Contact police?'];
if ( validateRequiredFields( f, a ) ){
return true;
}else{
return false;
}
} else {
return true;
}
}
// →
If field i_location contents value “Place” a want a validation on
a[a.length] = [f.i_OtherLocation, 'Place'];
If field i_type contents value “Corrupt” a want a validation on
a[a.length] = [f.i_totalcost, 'Total cost.'];
a[a.length] = [f.i_police_report, 'Contact police!'];
If field i_type contents ANY value a want a validation on på
a[a.length] = [f.i_description, 'Description for all.'];
a[a.length] = [f.i_action, 'What did you do?.'];