// JavaScript Document //checks a form for empty fields. function validate(f){ //initalise vFlag vFlag = true; //first get an array of all form elements. form = f.elements //the form elements that need validating have a div with an id name of 'fieldnameTip'. //so, to 'dynamically' find out which elements need validation, 'test' the existence //of a Div with the name 'fieldnameTip'. If the div exists, the form field needs validation. for(i=0;i