function popurl(url,small,id) { day = new Date(); if(!id) id = day.getTime(); width = screen.width-50; height = screen.height-100; if(small){ width = screen.width / small; height = screen.width / small; } eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+width+',height='+height+',top=25,left=25');"); return false; } function closeRefresh() { window.opener.location.reload(); window.close(); } var skip_validation = false; function skipValidation() { skip_validation = true; } // Form validation // object = the form object (in most cases just pass `this`) // fields = array of fields to check. // Example Usage-
function validate(object,fields) { if(skip_validation) return true; formerror = 0; for(var i in fields){ field = object[fields[i]]; if( field && !field.value ) { //field.style.border="1px solid red"; field.className += " validation_error" formerror = 1; } } if(formerror){ alert("Please fill in all required fields"); formerror = 0; return false; } return true; }