Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing certain FORM variables.

Status
Not open for further replies.

Markh51

Programmer
May 20, 2003
81
0
0
GB
Hi,

I have a problem when I am uploading images.

The problem is that a users completes the FILE fields and then clicks submit, the next page then uploads the files. The problem is if the user refreshes this page, it will upload the files again and again. So what I done is use a script, for when the FILE is completed it sets a HIDDEN value on the first page, then the idea was that when the upload had finished I would would set that value back to "", but I can't seem to change the value of a FORM variable without re-submitting the form.

Does any one know how to change a FORM variable's VALUE without re-submmiting the data, or have a better idea on how to stop it keep re-uploading ??

Thanks,
Mark

P.S The other problm is that when a uses goes back to the first page and changes the FILE field they SHOULD be allowed to re-upload their new file.
 
well,

ColdFusion is one of the only languages that will let you change form variables at all just because of this problem. A form variable is just a local variable unless it has been submited. SO... what I would do is either set a session variable to handle this, or...
you can gather the information from your forms... set the data in the database and then reload the page that displays the data. This will make it where if someone hits refresh it will not reload the form data. If someone hits back and then refresh it will... but that becomes more unlikely.

Have fun... I hope you get it working the way you want it to...



Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
i think the best way to prevent from reuploading is just using a <cflocation url=&quot;somepage.cfm&quot;> on you actionpage. Users can refresh that page till they drop without going through your actionpage agian.

chau
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top