Sent by Jeff Grippe on 06/28/2006 08:20:45 AM:
I can not re-organize the page to collect the password somewhere else other than at the time the form is submitted. This is something that my legal department has insisted on.
Sent by FoxWeb Support on 06/27/2006 08:31:45 PM:
In your original message you asked:
My question referred to the password value. I assume that the user enters a userid in the same form that contains the field that asks for the file to be uploaded. Is this correct? If yes, then why not split the forms in two pages. The first page will ask for the userid and password. Once the user clicks the submit button, a script on the server should validate the password and return a subsequent form that asks for the file to be uploaded.
If you don't want to split the forms, then you will need to use AJAX to make a request to the server, without actually submitting the form. I can't teach you how to employ AJAX technology in this forum, but you can look it up on the Web. A quick search will turn up lots of helpful information on this subject. This article is particularly useful: http://developer.mozilla.org/en/docs/AJAX:Getting_Started. In fact, the article contains everything you need to know in order to use AJAX in your FoxWeb scripts.
Sent by Jeff Grippe on 06/27/2006 01:58:07 AM:
I am not sure about the answer to "Do you know the value you are validating against?"
My typical FWX file has the following structure:
* SETUP CODE, GET Session Variables, Open Files, Run Queries, Etc.
I could lookup the password in the setup code but I think that may be too late, or is it? When is the '<%=pswd%>' from your example resolved? Does my setup code run first allowing me to retreive the value from a database
or session variable?
Sent by FoxWeb Support on 06/26/2006 09:47:40 PM:
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:
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.
The form line contains onsubmit="return validate()"
Thank you very much.