/* ValidateMain(form_object) USAGE: [A]: A valid javascript condition where 'f' is predefined to be the field object preceeding the hidden condition field, ge('name or id') returns given field object, and rc('name or id') returns string of 1s and 0s representing the checked or unchecked state of a group of fields with the given name or id [--+B]: Optional. Defines the field name or id that should receive the focus after the pop up message. By default, the field preceeding the hidden condition field receives the focus, however this may not be desirable [C]: Pop up message ValidateShort(form_object) and BufferFields() USAGE: Use this pair of functions to eliminate default text in a field upon submission. ValidateShort replaces ValidateMain for this purpose. It additionally predefines 'iv' as the initial value of the field preceeding the hidden condition field for use in the condition NOTE: iv is defined only for the field preceeding the hidden condition field, therefore, consecutive condition fields aren't supported for use with this var Buffer fields should be placed on the page after all forms that use ValidateShort */ var arrFormFields, iOffset=0; //Buffer up to one hundred fields from forms on page var arrFormFields=Array(100); for(i=0;i<100;i++) arrFormFields[i]=Array(2); //Validation code------------------------------------------- function ValidateMain(frm){ var i, k=0, f, iv, focus_value, value_pair, condition_value; e=frm.elements; for(i=0;i1){ focus_value=value_pair[1]; condition_value = value_pair[0].substring(2,value_pair[0].length); } else condition_value=e[i].name.substring(2,e[i].name.length); //alert(condition_value); if(eval(condition_value)){ alert(e[i].value); if(focus_value!=''){ focus_value = ge(focus_value); focus_value.focus(); if(focus_value.type!='select-one') focus_value.select(); } else{ e[k].focus(); if(e[k].type!='select-one') e[k].select(); } return false; } } else k=i; } return true; } function ge(sIdName){ var j=0; for(j=0;j