mmm, i can see what your doing with your example, but say i had a field called JustAnExample and that was within the 6 fields i passed, i think it would get a bit tricky trying to do get the relevant field out of the selection i sent it, would this work
Code:
Function AuditFields(Fields)
{
for (var i = 0; i < fields.length; i++) {
if (fields[i].value == "") {
fields[i].style.backgroundColor ="red"
} else {
var RelevantField;
RelevantField = document.getElementById('JustAnExample').value;
myFunction(RelevantField)
}
}
}
function myFunction (thefield) {
//do whatever you want with the field as long as you refer to it as thefield
}
Not sure if that correct but thats what i kind of had in mind?
And the function parameter Fields do i have to specify its an array of will the for loop realise? iv only just started javascript so please bare with me