473,287 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Help restore data from form fields in Internet Explorer

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
3 3751
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nicolas Keller | last post by:
Hi! I'm used to have Mozilla for testing my PHP sites when I'm coding. The site's nearly finished, now I've made a test with the Internet Exlporer... guess what... failed. The problem: I'm...
3
by: John Dunlop | last post by:
(Note crosspost and follow-ups to ciwah.) Nicolas Keller wrote in thread "Differences in form handling btw Mozilla and IE?": > The problem: I'm using a form that submit's (POST) its data via...
1
by: McKirahan | last post by:
What is "active content"? My ASP page just returns HTML.... I have a page with an .htm extension that has a form whose action is an ASP page which generates a report after updating a database...
1
by: Jenny | last post by:
Need urgent help for an unsolved problem. In our ASP web application, we creat a Back button and if user click on this button, it execute history.go(-1) to go back to the previous page. All our...
8
by: Brian F | last post by:
Exactly what the subject says. I have an ASP page that I want my C# windows application to open in Internet Explorer, and if possible have it send along a list of values from a list box. Thank you.
2
by: Dnna | last post by:
I have a table which is bound to an Internet Explorer XML data island. I'm using ASP.NET's client-side validators for an input field in the table. The problem is that if the input fields are in...
4
by: kaosyeti | last post by:
hey... i know NOTHING about sql server, .net framework or probably anything else on sql monster. i am a novice access user, self-taught for about 9 months now and have only a basic understanding...
5
by: Olly | last post by:
Hello Everyone! Could someone please have a look at my JS Form I posted below....Something wrong there, but I don't understand what's exactly. Many thanks. Olly ...
10
by: James | last post by:
Hello, as this falls under both VB and PHP I have posted this into two newsgroups (this is the first time I've done this so if it is mucked up then I'm sorry). Anyway I want to make some simple...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.