By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,693 Members | 1,754 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,693 IT Pros & Developers. It's quick & easy.

Help restore data from form fields in Internet Explorer

P: n/a
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/ ti*@tt1lock.org Remove lock to reply.
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I, Tim Tyler <ti*@tt1lock.org> 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/ ti*@tt1lock.org Remove lock to reply.
Jul 20 '05 #2

P: n/a
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

Jul 20 '05 #3

P: n/a
"Thomas 'PointedEars' Lahn" <Po*********@web.de> wrote in message
news:bo*************@ID-107532.news.uni-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.
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.