pls what is this error..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frances Del Rio

    pls what is this error..

    for screen shot pls see


    when viewing in netscape JS console it says 'document.phras e has no
    properties', which is very weird.. 'document.phras e' refers to the
    following:

    <form name="form">
    <input type=text name="phrase">


    var form = document.form

    function ff() {
    form.phrase.foc us() }

    function ff() is called in onLoad event handler in body tag..

    why does it say that document.phrase 'has no properties'? and why that
    error in IE? I have gotten this same error before but it displays error
    in usu. way, I had never seen it like this.. thank you.. Frances




  • mscir

    #2
    Re: pls what is this error..

    Frances Del Rio wrote:[color=blue]
    >
    > when viewing in netscape JS console it says 'document.phras e has no
    > properties', which is very weird.. 'document.phras e' refers to the
    > following:
    ><snip>[/color]

    I'm not sure why that doesn't work, this works in my IE6, Netscape 7.2,
    Firefox 1:

    <script type="text/javascript">
    function ff() {
    document.forms['form1'].elements['phrase'].focus();
    }
    window.onload = ff;
    </script>

    Comment

    • Randy Webb

      #3
      Re: pls what is this error..

      Frances Del Rio wrote:
      [color=blue]
      > for screen shot pls see
      > http://www.francesdelrio.com/error.gif
      >
      > when viewing in netscape JS console it says 'document.phras e has no
      > properties', which is very weird.. 'document.phras e' refers to the
      > following:[/color]


      [color=blue]
      > <form name="form">[/color]

      form is not a good name for form.
      [color=blue]
      > <input type=text name="phrase">
      >
      >
      > var form = document.form
      > function ff() {
      > form.phrase.foc us() }
      >
      > function ff() is called in onLoad event handler in body tag..
      >
      > why does it say that document.phrase 'has no properties'? and why that
      > error in IE? I have gotten this same error before but it displays error
      > in usu. way, I had never seen it like this.. thank you.. Frances[/color]

      Because you are using shortcut syntax to attempt to access a form
      control. Read the Group FAQ, via signature below, with regards to a
      proper way to access forms and the elements within.


      --
      Randy
      comp.lang.javas cript FAQ - http://jibbering.com/faq
      Answer:It destroys the order of the conversation
      Question: Why?
      Answer: Top-Posting.
      Question: Whats the most annoying thing on Usenet?

      Comment

      • Frances Del Rio

        #4
        Re: pls what is this error..



        mscir wrote:[color=blue]
        > Frances Del Rio wrote:
        >[color=green]
        >>
        >> when viewing in netscape JS console it says 'document.phras e has no
        >> properties', which is very weird.. 'document.phras e' refers to the
        >> following:[/color]
        >[color=green]
        > ><snip>[/color]
        >
        > I'm not sure why that doesn't work, this works in my IE6, Netscape 7.2,
        > Firefox 1:
        >
        > <script type="text/javascript">
        > function ff() {
        > document.forms['form1'].elements['phrase'].focus();
        > }
        > window.onload = ff;
        > </script>[/color]

        indeed it does...... thank you very much... one truly wonders why the
        other way it wouldn't work, it's standard dot-syntax... but.. what
        works works... ;) thanks again.. Frances

        Comment

        Working...