Option Explicit

dim validation, header
header = "Incorrect Data Entered"

Sub Check(ByVal FieldValue, ByVal message)
        	If FieldValue = "" Then
            		MsgBox message, 8, Header	
            		validation = False
            	End If
End Sub

Function Login_OnSubmit
	validation = true
	Call Check(Document.login.uname.Value, "Please enter your user name.")
	if validation = true then
		Call Check(Document.login.pword.Value, "Please enter your account password.")
	end if

	if validation = false then
		Login_OnSubmit = False
	else
		Login_OnSubmit = true
	end if
End Function
