dim val_msgboxtitle dim val_violationcolor dim val_normalbgcolor val_msgboxtitle = "SEIS Automated Help" val_violationcolor = "#FFD9D9" val_normalbgcolor = "#ffffff" '----------------------------------------------------------------------------- 'FORM VALIDATION '----------------------------------------------------------------------------- Function Validate Validate = False dim i dim j 'INPUT BOXES For each i in document.getElementsByTagName("input") If i.className = "controls_input_req" Then select case i.getAttribute("datatype") case "string" if len(i.value) = 0 Then msgbox i.getAttribute("errMsg"),vbExclamation,val_msgboxtitle i.style.background = val_violationcolor i.focus() Exit Function else i.style.background = val_normalbgcolor end if case "int" case "date" End Select End If Next 'SELECT BOXES For each j in document.getElementsByTagName("select") If j.className = "controls_input_req" Then if j.value = "0" Then msgbox j.getAttribute("errMsg"),vbExclamation,val_msgboxtitle j.style.background = val_violationcolor j.focus() Exit Function else j.style.background = val_normalbgcolor end if End If Next Validate = True Exit Function End Function '----------------------------------------------------------------------------- 'RESET FORM '----------------------------------------------------------------------------- Sub Validate_Reset dim i For each i in document.getElementsByTagName("input") If i.className = "controls_input_req" Then i.style.background = val_normalbgcolor End If Next Exit Sub End Sub