Web Analytics Made Easy -
StatCounter auto click?? - CodingForum

Announcement

Collapse
No announcement yet.

auto click??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • auto click??

    can someone help me to write a code to autoclick the following codes?
    note that the codes are partial codes.. help me to write the solution into a script file

    Code 1
    <table class="bgmain" width="99.75%" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top">

    <form method="POST" action="tvalidate.php">
    <input type="hidden" name="id" size="20" value="29409"><input type="hidden" name="xfile" size="20"

    value="29409.pdf">&nbsp;<input type="submit" value="Download" name="Enter">
    </form>


    Code 2
    <div class="smallcurve">
    <div class="t"><div class="r"><div class="b"><div class="l"><div class="tl"><div class="tr"><div

    class="bl"><div class="br">
    <div class="smallcontent">

    <table width="100%" border="0" cellpadding="5" cellspacing="0" align="center"><tr><td>

    </ul>
    </td></tr></table>
    <center>
    <form method=POST action=http:blablabla.com/29409.pdf><b>Full-Text Document View/ Download :</b>
    <input type=image border=0 align=absmiddle src=./images/pimages.jpg title="Click here to view full-

    text item">

  • #2
    Do you need help or do you just want someone to create the code for you? If #1 applies then please show us what you have tried so far so someone can build upon that or show you the right apporach. If #2 applies then please make an inquiry in the marketplace section since this here is not the right section to request work to be done.
    Stop solving problems you don’t yet have!

    Comment


    • #3
      here are some of the functions that i think is appropriate... (i found it over the internet)... (i just a beginner in c language so, it is kinda hard to write some of the java script functions since the syntax is different)..

      function mouseover()
      {
      time = 0.9E3; //clicks after 0.9s

      link = this;

      timeout = window.setTimeout(autoclick, time);
      }

      function clear()
      {
      link = null;

      if (timeout)
      {
      window.clearTimeout(timeout);
      }
      }

      function autoclick()
      {
      if (!timeout)
      {
      return;
      }

      document.location = link.href;
      }

      Comment


      • #4
        So you don't *really* need an auto-click.

        You just want to jump to a different page after X amount of time?

        If you mean that you want those two <form>s to post, then you can't do it the way you are attempting, because the <form> data will *not* be sent along with the URL.

        The simple way is to call the submit() method on the <form>s involved.

        So, for example:
        Code:
        <html>
        <head>
        <script type="text/javascript">
        setTimeout( "document.forms[0].submit()", 900 ); // submit first form on page in 900 milliseconds
        </script>
        </head>
        <body>
        .... body of the page ...
        </body>
        </html>
        If there is more than one <form> tag on the page and you want to submit other than the first one, change the number in document.forms[0].submit() to match.
        Be yourself. No one else is as qualified.

        Comment


        • #5
          old pedant: I don't really understand what you mean. I rephrase my question.

          Code 1
          <table class="bgmain" width="99.75%" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top">

          <form method="POST" action="tvalidate.php">
          <input type="hidden" name="id" size="20" value="29409"><input type="hidden" name="xfile" size="20"

          value="29409.pdf">&nbsp;<input type="submit" value="Download" name="Enter">
          </form>

          say code 1 is in file:///C:/Users/User/Desktop/page1.htm
          there is a button "Download" right? When I click it manually, it will go to file:///C:/Users/User/Desktop/tvalidate.php right?

          But, I don't want to click it manually, how can i skip to
          file:///C:/Users/User/Desktop/tvalidate.php after X seconds?
          [Without changing the codes in file:///C:/Users/User/Desktop/page1.htm]







          Code 2 is in file:///C:/Users/User/Desktop/tvalidate.php
          Code 2
          <div class="smallcurve">
          <div class="t"><div class="r"><div class="b"><div class="l"><div class="tl"><div class="tr"><div

          class="bl"><div class="br">
          <div class="smallcontent">

          <table width="100%" border="0" cellpadding="5" cellspacing="0" align="center"><tr><td>

          </ul>
          </td></tr></table>
          <center>
          <form method=POST action=http:blablabla.com/29409.pdf><b>Full-Text Document View/ Download :</b>
          <input type=image border=0 align=absmiddle src=./images/pimages.jpg title="Click here to view full-

          text item">


          there is a button "Full-Text Document View/ Download :" right? When I click it manually, it will go to http:blablabla.com/29409.pdf right?

          But, I don't want to click it manually, how can i skip to
          http:blablabla.com/29409.pdf after X seconds?
          [Without changing the codes in file:///C:/Users/User/Desktop/tvalidate.php]





          "The simple way is to call the submit() method on the <form>s involved.

          So, for example:
          Code:

          <html>
          <head>
          <script type="text/javascript">
          setTimeout( "document.forms[0].submit()", 900 ); // submit first form on page in 900 milliseconds
          </script>
          </head>
          <body>
          .... body of the page ...
          </body>
          </html>

          If there is more than one <form> tag on the page and you want to submit other than the first one, change the number in document.forms[0].submit() to match."

          writing a separate script file like what you said will work?
          Last edited by yongs; Aug 29, 2011, 01:58 AM.

          Comment


          • #6
            Ahh...you added the poison phrase!
            Code:
            [Without changing the codes in file:///C:/Users/User/Desktop/page1.htm]
            *IF* the two pages are served FROM THE SAME DOMAIN, it can be done. You can have the master page "pop up" the "page1.html" and then it can control it the way I showed.

            But if your master page and the page you want to affect are from different domains (www.xyz.com versus www.abc.org or whatever) then you can't do it. It's a browser security issue.

            And completely different rules apply if you really do mean you want to do this with HTML files on the local machine, not the server.
            Be yourself. No one else is as qualified.

            Comment

            Working...
            X
            😀
            🥰
            🤢
            😎
            😡
            👍
            👎