Help restore data from form fields in Internet Explorer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tim Tyler

    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/ tim@tt1lock.org Remove lock to reply.
  • Tim Tyler

    #2
    Re: Help restore data from form fields in Internet Explorer

    I, Tim Tyler <tim@tt1lock.or g> wrote or quoted:
    [color=blue]
    > 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?[/color]

    <body onLoad="javascr ipt:restore_sta te_from_form_fi elds('test');">

    ....is enough, it seems.
    --
    __________
    |im |yler http://timtyler.org/ tim@tt1lock.org Remove lock to reply.

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: Help restore data from form fields in Internet Explorer

      Tim Tyler wrote:
      [color=blue]
      > <body onLoad="javascr ipt:restore_sta te_from_form_fi elds('test');">
      >
      > ....is enough, it seems.[/color]

      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

      Comment

      • Richard Cornford

        #4
        Re: Help restore data from form fields in Internet Explorer

        "Thomas 'PointedEars' Lahn" <PointedEars@we b.de> wrote in message
        news:boqupk$1ft 23v$2@ID-107532.news.uni-berlin.de...[color=blue][color=green]
        >><body onLoad="javascr ipt:restore_sta te_from_form_fi elds('test');">
        >>
        >> ....is enough, it seems.[/color]
        >
        >Remove the `javascript:', URIs are wrong here and a label is
        >not needed but will cause problems.[/color]
        <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.


        Comment

        Working...