SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    auto form submit

    i have proxy site and i added some quick link icons under the url form. i want to make the quicklinks work so that when you click the link, it proxifies the page automatically, currently the script i have just pass the link to the form and you have to press the GO button

    im not very good at javascript so little help needed, i dont think its big task

    HTML Code:
    <script language="JavaScript"> 
    // pass variable to field
    function passit(str)
    {document.passit.u.value=str}
    </script> 
    
             <form name="passit" action="includes/process.php?action=update" method="post" onsubmit="return updateLocation(this);" class="form">
                <input type="text" name="u" id="input" size="40" class="textbox">
                <input type="submit" value="Go" class="button">
                &nbsp;
                [<a style="cursor:pointer;" onclick="document.getElementById('options').style.display = (document.getElementById('options').style.display=='none'?'':'none')">options</a>]
                <ul id="options">
    <?php foreach ( $toShow as $option ) echo <<<HTML
                   <li>
                      <input type="checkbox" name="{$option['name']}" id="{$option['name']}"{$option['checked']}>
                      <label for="{$option['name']}" class="tooltip" onmouseover="tooltip('{$option['escaped_desc']}')" onmouseout="exit();">{$option['title']}</label>
                   </li>
    HTML;
    ?>
                </ul>
    			<br style="clear: both;">
    			 <!---[QUICKLINKS]--->
    			 <div onmouseover="tooltip('Click the icon and your on the way to the site.')" onmouseout="exit();" id="icolinks" class="icolinks">
    		   <a href="javascript:passit('www.youporn.com')"><img alt="Youporn" src="http://static.youporn.com/images/favicon4.ico"></a>
               <a href="javascript:passit('www.starkingdoms.com')"><img alt="Starkindoms" src="http://www.starkingdoms.com/favicon.ico"></a>
    		   <a href="javascript:passit('www.meebo.com')"><img alt="Meebo" src="http://www.meebo.com/favicon.ico"></a>
    		   <a href="javascript:passit('www.facebook.com')"><img alt="Facebook" src="http://www.facebook.com/favicon.ico"></a>
    		   <a href="javascript:passit('www.youtube.com')"><img alt="" src="http://www.youtube.com/favicon.ico"></a>
    		   <a href="javascript:passit('www.rapidshare.com')"><img alt="" src="http://www.rapidshare.com/img2/favicon.ico"></a>
    		   <a href="javascript:passit('www.dailymotion.com')"><img alt="" src="http://www.dailymotion.com/images/favicon.ico"></a>
              
    		   <br>
    		   </div>
    <br> 
                <br style="clear: both;">
             
             </form>
    what to do?, dont really have any idea

  2. #2
    SitePoint Zealot Mattinblack's Avatar
    Join Date
    May 2009
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post

    Quote Originally Posted by Lovsan View Post
    HTML Code:
    <script language="JavaScript"> 
    // pass variable to field
    function passit(str)
    {document.passit.u.value=str}
    </script> 
    .....
    what to do?, dont really have any idea
    HTML Code:
    function passit(str){
    document.passit.u.value=str;
    document.passit.submit();
    }
    Thats all!

  3. #3
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •