If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > File input clears after back button clicked

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-08, 08:00
plsh plsh is offline
Registered User
 
Join Date: Nov 2004
Posts: 253
File input clears after back button clicked

Good day,

I have an asp page with a few textboxes on it as well as a file input box that I use to save the file location of a file. Everything is working well except that should they click the button to submit the form and want to change a value in one of the boxes and click the browsers back button the input file box is cleared but everything else retains there value. Is there anyway to make the browser retain the value entered in the input file box?

Please help, thanks.
Reply With Quote
  #2 (permalink)  
Old 04-08-08, 08:11
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
I don't like the fact you're allowing your users to go back and re-submit the same data...

Often you will find that one page submit, the controls will be cleared, and perhaps the values are stored in a session variable to be loaded on page open...
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 04-09-08, 03:29
plsh plsh is offline
Registered User
 
Join Date: Nov 2004
Posts: 253
Sorry really bad explanation. I have checks that when they submit the form if certain fields are empty it will tell them and they need to click the back button and then go and enter in values. Now if they have selected a file in the file input box and left one of the other fields empty when they click the back button to enter a value the file input box is cleared but the rest of the fields that had values in them, textboxes, listboxes and combo's, retain their values. I am trying to make sure the file input box retains its value as well.
Reply With Quote
  #4 (permalink)  
Old 04-09-08, 09:23
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
When it comes to form validation, generally you want to use something that runs client side (e.g. JavaScript); so that the users don't submit the form incurring another http request.

If javascript is not your bag, then instead of telling your users to use the back button; they should click a link back the to page that you supply; or better yet you redirect them back!

Then the technique mentioned beforehand (storing and retrieving values from session variables) will be your friend.

Hope this helps
__________________
George
Twitter | Blog
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On