clicking the hyperlink on onload event of body using script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnuSumesh
    New Member
    • Aug 2007
    • 96

    clicking the hyperlink on onload event of body using script

    hi

    I want to submit the form and click the link on body load event. i m using the following code:

    <script>

    Function clicklinl()
    {
    document.getEle mentById("back" ).click();
    }

    </script>
    <html>
    <body onLoad="test.su bmit();clicklim k()" >

    <form name="test" action="test.vb s">
    <a id="back" href="RDPServer List.asp">back</a>
    </form>

    </body>
    </html>

    I want to run firstly test.vbs file and then come back to RDPServerList.a sp page.
    here form is submitted i.e. vbs file starts executing but link is not clicked.

    can anyone help me in this issue.
    thanks in advance.

    anu
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    HTML and CSS can't do this. Ask over in the JavaScript forum.

    Also be more specific in your question it has a quite a few grammical errors.

    Thanks, Death

    Comment

    • AnuSumesh
      New Member
      • Aug 2007
      • 96

      #3
      clicking the hyperlink on onload event of body using script

      hi

      I want to submit the form and click the link on body load event. i m using the following code:

      [HTML]<script>

      Function clicklink()
      {
      document.getEle mentById("back" ).click();
      }

      </script>
      <html>
      <body onLoad="test.su bmit();clicklin k()" >

      <form name="test" action="test.vb s">
      <a id="back" href="RDPServer List.asp">back</a>
      </form>

      </body>
      </html>[/HTML]

      I want to run firstly test.vbs file and then come back to RDPServerList.a sp page.
      here form is submitted i.e. vbs file starts executing but link is not clicked.

      can anyone help me in this issue.
      thanks in advance.

      anu
      Last edited by gits; Nov 30 '07, 08:28 AM. Reason: added code tags

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        When the form is submitted to test.vbs, it's leaving the page. Just redirect in your action page.

        PS. please use code tags when posting code. Thanks!

        Comment

        • AnuSumesh
          New Member
          • Aug 2007
          • 96

          #5
          First of all thanks for reply.
          Sorry i did not understand what u want to say. how to redirecr.
          my action page is vbs file.

          can u please explain me in more detail?

          Thanks a lot.
          Anu

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            When you submit a form, the page will unload and go to the action page.

            Here the action page is test.vbs, so you should redirect from there.

            I'm not sure how you redirect in a .vbs file.

            Alternatively, just set the action page as the current page (which should deal with the form input).

            Comment

            Working...