JS newbie needs help with JS

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?.'];

Subject: JS newbie needs help with JS

I’m not sure I understand all of your questions, but I’ll try. My first observation is that using single-letter variable names will be very difficult to support because the next developer will be guessing what f and v mean (I see that f is the form).

Second, I think you need to get the VALUE of each field.

e.g.

a[a.length] = [ f.Name.value, ‘Fullname’ ];

Third, I’m not sure about your syntax storing arrays within arrays (it may work, but I have not seen it like that).