Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 30th, 2015, 10:14 AM
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turning off client-side validation Oleg Kolpashchikov BOOK: Professional ASP.NET 4.5 : in C# and VB 4 July 11th, 2013 02:23 AM
Client Side Validation anujrathi ASP.NET 1.0 and 1.1 Professional 1 June 17th, 2006 10:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.