View Complete Thread | FoxWeb Forum Home
Date:    Msg ID:   
From:    Thread:   
Do you know the value you are validating against at the time that the form is served by FoxWeb?  If yes, you can dynamically create some JavaScript code that sets the variable value dynamically:

<script language="JavaScript">

var password='<%=pswd%>';


<form ... (your form)

You could even populate an array with a bunch of values.
If, on the other hand, you are validating against a large set of values (such as your password example), then there are two options:
  1. Split data entry into two pages.  First ask for the values that need to be validated and in the following request return a form that asks for the file upload.
  2. Use AJAX to retrieve the values that you want to validate against.  There are lots of resources on the web that provide information on this subject.

FoxWeb Support Team email

Sent by Jeff Grippe on 06/26/2006 01:28:51 PM:
I need to validate a form value before the user clicks submit in order to prevent a long file upload when a required password is incorrect.
For validating dates and amount ranges I use a javascript function called validate in some of my forms.
The form line contains onsubmit="return validate()"
Is there some way to load a value (such as the password that I need to check) into a variable that javascript can access so that I can write code in my validate function to check it against the value in a text input field?
Thank you very much.