I'm trying to make a 'Create User Account' page with asp and vb script.
I want to validate the text box entries before passing to the next page.
I searched the forums and tried to use the most promissing code I could find, but it's not working.
It just goes to the next page as soon as you click the submit button.

Can anyone help?

Code:
<HTML>
<HEAD>
<title>New Account</title>

<SCRIPT Language="vbscript">
function Validate

Msgbox "Just a test pop-up !!!"
   If (document.form.UserName.value = "" or _
        document.form.Password.value = ""  or _
        document.form.Confirm.value = "" ) Then
       Msgbox "Fill in text box !!!"
       Validate = false
   Else
       Validate = true
   End If
end function
</SCRIPT>

</HEAD>

<BODY>

<CENTER>
<BR>
<BR>

<FORM NAME="Logn" METHOD="post" ACTION="index.shtml">
<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="7" WIDTH="250" BGCOLOR="#6B656B">
  <TR>
    <TD>
	<H3>Create a New Account</H3>

	&nbsp;User Name:<BR>
	<INPUT TYPE="text" NAME="UserName" SIZE="30">
	<BR>
	<BR>

	&nbsp;Password:<BR>
	<INPUT TYPE="text" NAME="Password" SIZE="30">
	<BR>
	<BR>

	&nbsp;Confirm Password:<BR>
	<INPUT TYPE="text" NAME="Confirm" SIZE="30">
	<BR>
	<BR>
	<CENTER>
	<INPUT TYPE="Submit" NAME="Apply" VALUE="Submit" OnSubmit="vbscript: Validate">
</CENTER>
    </TD>
  </TR>
</TABLE>
</FORM></CENTER>

</BODY>
</HTML>