Need help with onClick onmouseup etc... and a submit button

Discussion in 'JavaScript' started by Daniel591992, Aug 9, 2007.

  1. #1
    Hey, take a look at this:

    http://dodesign.us/live/quickproxy/index.php

    Click on popular links, and chose one of the sites. The site URL is written to the textbox and the advanced options come up. The code is something like this:

    <td><a onClick="document.a.q.value='http://myspace.com'" onmouseup="toggle('toggle1');" onkeyup="change();" >Myspace</a></td>
    Code (markup):
    That works...for the most part. I also want the textbox to change its border color when the link is clicked, to make the visitor more aware that a link was written in the textbox. That's what the change(); is supposed to do. This is the code for the change();

    <script language="JavaScript">
    function change(){
    document.getElementById("url").style.borderColor = "#111111";
    document.getElementById("url").style.backgroundColor = "#000000";
    document.getElementById("url").style.color = "#ffffff";
    }
    </script>
    
    Code (markup):
    How can I make that work?



    Problem 2:

    I have the search google button on the page, but I don't know how to make it work. As you can imagine, I want it to search google, but proxied.

    When you do a google search, it's basicly http://www.google.com/search?q=SEARCH+TERM+HERE. How could I do that so it takes the search term from the url box and transforms it into the above url and works with the proxy?

    I'll give anyone who can help me solve this a link on dodesign.us for as long as the current design stays.

    If you can help via IM:

    aim:daniel591992
    msn:cadagobr1[at]gmail.com
    gtalk: ^same

    Thanks
     
    Daniel591992, Aug 9, 2007 IP
  2. Daniel591992

    Daniel591992 Well-Known Member

    Messages:
    594
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    125
    #2
    I got the first thing working now. Can someone help with the second?
     
    Daniel591992, Aug 9, 2007 IP
  3. Drag Racer

    Drag Racer Peon

    Messages:
    20
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    <form action="http://www.google.com/search">
    <input name="q">
    <input type="submit" value="Search Google">
    </form>
    Code (markup):
     
    Drag Racer, Aug 10, 2007 IP