View Single Post
 
Old April 30th, 2015, 10:14 AM
misterman misterman is offline
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Client-Side Validation Blues

Problem: All the lines of code that I wrote for events in client-side validation refused to fire.

Situation on ground: I wrote a custom-written ActiveX control that accepts what I reffer to as usercode. The AX sits on an ASP. The ASP has a submit button and a reset button

Problem: All the lines of code that I wrote for events in client-side validation refused to fire.

Situation on ground
: I wrote a custom-written ActiveX control that accepts what I refer to as usercode. The AX sits on an ASP. The ASP has a submit button and a reset button. The name of the form is frmLogin. Take a look at the code snippet:

<form method="post" name="frmLogin" action="Login.asp" onSubmit="frmLogin_OnSubmit">. Here is the whole client-side
Code:
 

<script Language="VBScript">
<!--
	Function Frmlogin_onSubmit
	    Dim iRet 
	    ggg
	    msgbox Trim(frmLogin.Login1.Status)
	    If Trim(frmLogin.Login1.Status) = "Old" Then
     		If Trim(frmLogin.Login1.usercode) = "" Then
	           iRet = MsgBox("   Enter the usercode  ", 0, "www.website.com")
	           Frmlogin_onSubmit = False
	           FrmLogin.Login1.GetFocus()
	           Exit function
    	    End If
    	end if
'    	
    	FrmLogin.HiddenUsercode.value =  Trim(frmLogin.Login1.Usercode) 
    	FrmLogin.HiddenStatus.Value = frmLogin.Login1.Status
    	Frmlogin_onSubmit = True
   End Function
   
   Sub Reset_OnClick
    	FrmLogin.Login1.Usercode = ""
	msgbox "Reset"
   End Sub
	
	Sub Window_OnLoad
		FrmLogin.Login1.GetFocus()
	End Sub
	
-->
</script>
The code used to work as expected. I can't remember what happened. The events are not fired at all. For example, I intentionally made a mistake in Frmlogin_onSubmit by the ggg stuff. The message box that follows whas not displayed. The reset button was not fired as well (a normal button). As soon as I clicked on submit, the form is submitted. The value of Usercode and status which are in HiddenUsercode and HiddenStatus are NOT passed.

If it helps, I am running Win 7. I am pretty sure the problem is not from the code. Thanks for your suggestions