Home | Advertising Info139 USERS CURRENTLY ONLINE   
   Site Search Contact Us Friday, March 14, 2025  
 
 


 
ASPProtect
User Management Application with web based screens that allow you to manage users.
www.ASPProtect.com
 
ASPBanner
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
www.ASPBanner.com
 
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
www.ASPPhotoGallery.com
 
ASPClassifieds
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.
www.ASPClassifieds.com



DISCUSSION ARCHIVES
 



We didn't realize
the site was so popular.

Other Stuff
 

 
 
Active Server Pages ASP a directory of ASP tutorials applications scripts components and articles for the novice to professional developer. CJWSoft ASPProtect ASPBanner ASPClassifieds



(Advanced)  (Components)  (Database)  (General)  (Vbscript)




ASPProtect

 
Subject: Re: client-side javascript code doesnt run
From: Harlan
Date: 3/8/1999 4:35:22 PM
IP: 206.222.20.2



 

I think I posted this in the vi6 form, but I doubt you would have found it even if you knew it was there. Here is the function I wrote for javascript validation..

'----------------------------------------------------------------
'Name: CreateValidate()
'Purpose: Create Javascript Validate
'----------------------------------------------------------------
' Takes: comma delimited string of form elements to validate.
'----------------------------------------------------------------
' Returns: Nothing
'----------------------------------------------------------------
Sub CreateValidate(strArrayValidationFields)
%>
<Script language="JavaScript">
function Validate(objForm) {
<%
Fields = Split(strArrayValidationFields,",")
For i = 0 to UBound(Fields)
response.write vbTab & "if (objForm." & fields(i) & ".value == " & chr(34) & chr(34) & ") {" & vbCrLf
response.write vbTab & "alert(" & chr(34) & "\n" & fields(i) & " is a requried field.\nPlease complete it and try again." & chr(34) & ")" & vbCrLf
response.write vbTab & "objForm." & fields(i) & ".focus()" & vbCrLf
response.write vbTab & "}" & vbCrLf
response.write vbTab & "else "
Next%>
{
objForm.submit()
}
}
</Script>
<%
End Sub
%>

here is how you use it..
<%call CreateValidate("txtName,txtAddy")%>
<form name='frmSomeForm' method='post'>
<input type='text' name='txtName'>
<input type='text' name='txtAddy'>
<input type='text' name='txtPhone'>
<input type='Button' name='Submit' Value='Submit' onClick="Validate(this.form)">
</form>

if you notice, I'm make sure they fill in
txtName and txtAddy, but they don't have to
fill in txtPhone. You can send it as many form
input names as you want to validate. Its a
good idea to add call the sub in the <head>
rather then the body (although it works in both).

hth,

Harlan

Previous Message


 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com