Click here to get back home

javascript back drops file value

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
javascript back drops file value Mark D Smith 04-22-2005
Get Chitika Premium
Posted by Mark D Smith on April 22, 2005, 10:01 am
Please log in for more thread options


Hi

I am using input type file to upload a logo for a form using php.
Now i have a preview button and if the user uses the browse button to select
an allowed image (input box contains say c:imagesimage1.jpg) when
previewed the code displays the image and any text in a textbox ok.
Using <input type="submit" value="<< Back"
onClick="javascript:history.back();"> the form keeps all inputs but looses
the c:imagesimage1.jpg

is there a way round this or do i have to live with it?

Mark



Posted by kaeli on April 22, 2005, 8:32 am
Please log in for more thread options


usenet@NOSPAM.obantec.net enlightened us with...
> Hi
>
> I am using input type file to upload a logo for a form using php.
> Now i have a preview button and if the user uses the browse button to select
> an allowed image (input box contains say c:imagesimage1.jpg) when
> previewed the code displays the image and any text in a textbox ok.
> Using <input type="submit" value="<< Back"
> onClick="javascript:history.back();"> the form keeps all inputs but looses
> the c:imagesimage1.jpg
>
> is there a way round this or do i have to live with it?

The fact that the fields stay filled in at all is browser-dependent.

To ensure everyone gets to keep the values, take care of it on the server
side by not using history.back and instead use a link that goes to that page
with URL params (or a form with post, or session vars, or whatever) then use
PHP to fill in the values.


--
--
~kaeli~
Abdicate (v.), to give up all hope of ever having a flat
stomach.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace



Posted by Mark D Smith on April 22, 2005, 3:02 pm
Please log in for more thread options


> usenet@NOSPAM.obantec.net enlightened us with...
> > Hi
> >
> > I am using input type file to upload a logo for a form using php.
> > Now i have a preview button and if the user uses the browse button to
select
> > an allowed image (input box contains say c:imagesimage1.jpg) when
> > previewed the code displays the image and any text in a textbox ok.
> > Using <input type="submit" value="<< Back"
> > onClick="javascript:history.back();"> the form keeps all inputs but
looses
> > the c:imagesimage1.jpg
> >
> > is there a way round this or do i have to live with it?
>
> The fact that the fields stay filled in at all is browser-dependent.
>
> To ensure everyone gets to keep the values, take care of it on the server
> side by not using history.back and instead use a link that goes to that
page
> with URL params (or a form with post, or session vars, or whatever) then
use
> PHP to fill in the values.
>
>
> --
> --
> ~kaeli~
> Abdicate (v.), to give up all hope of ever having a flat
> stomach.
> http://www.ipwebdesign.net/wildAtHeart
> http://www.ipwebdesign.net/kaelisSpace
>

Good idea! I'll simple have it post the data back and as you say have php
fill in the values.

Mark



Similar ThreadsPosted
Validating file tag using javascript March 6, 2006, 4:21 am
javascript file (.js) on hard disk January 16, 2005, 9:53 am
in Firefox March 19, 2008, 9:57 pm
File Uploads using October 13, 2004, 9:19 pm
Playing a local mpeg file from a local HTML file... July 24, 2005, 6:02 pm
non-ssl to SSL and back again how to? July 22, 2006, 9:29 am
iCapture is back October 26, 2004, 11:24 am
back link January 25, 2007, 10:46 pm
Forward and Back buttons? May 14, 2005, 8:40 am
Possibly OT - would like to have an element back March 26, 2005, 9:46 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap