Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Help restore data from form fields in Internet Explorer

Reply
Thread Tools

Help restore data from form fields in Internet Explorer

 
 
Tim Tyler
Guest
Posts: n/a
 
      11-10-2003
The user has come back to my page - and I have session data held in
hidden form fields that I want to restore.

Getting these values using Javascript works fine in Mozilla Firebird - and
the like - but there's a problem with Internet Explorer (6).

IE apparently fills in the form fields the way they were *after*
the page is loaded.

Executing Javascript while the page is loading gets the original
default values - not the ones left stored in the form fields when
the page was last exited

I'm sure this must be a common issue - can any kind soul point me
to the best way to work around the problem?

Thanks in advance for any assistance!
--
__________
|im |yler http://timtyler.org/ http://www.velocityreviews.com/forums/(E-Mail Removed) Remove lock to reply.
 
Reply With Quote
 
 
 
 
Tim Tyler
Guest
Posts: n/a
 
      11-10-2003
I, Tim Tyler <(E-Mail Removed)> wrote or quoted:

> The user has come back to my page - and I have session data held in
> hidden form fields that I want to restore.
>
> Getting these values using Javascript works fine in Mozilla Firebird - and
> the like - but there's a problem with Internet Explorer (6).
>
> IE apparently fills in the form fields the way they were *after*
> the page is loaded.
>
> Executing Javascript while the page is loading gets the original
> default values - not the ones left stored in the form fields when
> the page was last exited
>
> I'm sure this must be a common issue - can any kind soul point me
> to the best way to work around the problem?


<body onLoad="javascript:restore_state_from_form_fields( 'test');">

....is enough, it seems.
--
__________
|im |yler http://timtyler.org/ (E-Mail Removed) Remove lock to reply.
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      11-11-2003
Tim Tyler wrote:

> <body onLoad="javascript:restore_state_from_form_fields( 'test');">
>
> ....is enough, it seems.


Remove the `javascript:', URIs are wrong here and a label is not needed
but will cause problems.

Instead, define the default scripting language in the `head' element:

<meta http-equiv="Content-Script-Type" content="text/javascript">


PointedEars

 
Reply With Quote
 
Richard Cornford
Guest
Posts: n/a
 
      11-11-2003
"Thomas 'PointedEars' Lahn" <(E-Mail Removed)> wrote in message
news:boqupk$1ft23v$(E-Mail Removed)-berlin.de...
>><body onLoad="javascript:restore_state_from_form_fields( 'test');">
>>
>> ....is enough, it seems.

>
>Remove the `javascript:', URIs are wrong here and a label is
>not needed but will cause problems.

<snip>

I have never seen any evidence of the use of superfluous labels in the
internally generated event handling functions causing problems, unlike
the use of javascript: URIs in HREF attributes (which certainly do cause
undesirable side effects). Of course because IE would treat the
'javascript:' as an indicator of the type of script language to use for
the attribute code it would be inadvisable to use it as a label in that
context as the label would be missing form the generated function on IE,
but its inclusion does seem to be harmless when it is treated as a label
but never referred to as such.

I would not recommend prefixing event handling attribute string values
with 'javascript:' (assuming that JavaScript is the default (and/or
only) language anyway), but the worst I would say about it is that it is
an unnecessary 11 bytes of download that servers no practical purpose in
normal use and may blur the distinction between event handling
attributes and (the inadvisable use of) javascript: HREFs in the mind of
the code author.

Richard.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer 8: C:\Program Files\Internet Explorer\iexplore.exe vs C:\Program Files (x86)\Internet Explorer\iexplore.exe Nathan Sokalski Windows 64bit 16 02-22-2010 08:31 AM
internet explorer 7 - Internet Explorer cannot display the webpag sandy j Windows 64bit 0 05-02-2009 02:12 AM
internet explorer cannot read post data from form JohnathanKong ASP General 0 10-18-2007 06:55 PM
Need help to restore "explorer.exe" functionality. Note this is NOT an Internet Explorer issue. oldsoul Computer Support 10 07-12-2005 03:09 PM
Problem with events on dynamically created input fields in internet explorer Thomas Javascript 6 04-15-2005 01:00 AM



Advertisments