body onload problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Clive Moore

    body onload problem

    I am working with JSP and have a top and bottom jsp for each screen of
    my application. I call javascript event that processess a form on one
    of these screens.

    This works fine on screen 1 but on screen two where the form is not
    present the function is still called and i get and error message in the
    browser saying that

    'document.searc hForm.moveFromD ate' is not an object.

    Is it possible to check that the form is present before the function
    trys to do anything?

    Any help would be much appreciated.

    Thanks
    Clive


    --
    Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
  • Martin Honnen

    #2
    Re: body onload problem



    Clive Moore wrote:
    [color=blue]
    > I am working with JSP and have a top and bottom jsp for each screen of
    > my application. I call javascript event that processess a form on one
    > of these screens.
    >
    > This works fine on screen 1 but on screen two where the form is not
    > present the function is still called and i get and error message in the
    > browser saying that
    >
    > 'document.searc hForm.moveFromD ate' is not an object.
    >
    > Is it possible to check that the form is present before the function
    > trys to do anything?[/color]

    Check
    <body onload="if (document.forms .searchForm &&
    document.forms. searchForm.elem ents.moveFromDa te) {
    // access
    document.forms. searchForm.elem ents.moveFromDa te here
    }">

    --

    Martin Honnen


    Comment

    • Clive Moore

      #3
      Re: body onload problem

      That work Martin

      Thanks
      Clive



      --
      Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

      Comment

      Working...