Auto connection when selection is selected

Discussion in 'PHP' started by onlyican.com, Jan 3, 2006.

  1. #1
    Without Java, can i Make a Selection box, so when someone chooses an option, the page loads, without them having to click Submit.

    <form method="get" action="page2.php">
    <select name="location"><option value="no">Please Select</option><option>USA</option><option>GB</option></select>
    </form>

    So when someone chooses example USA, the page loads.

    HOW??
     
    onlyican.com, Jan 3, 2006 IP
  2. n0other

    n0other Peon

    Messages:
    146
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Without Java - yes. Without Javascript - no :). onchange="return this.form.submit();" ..
     
    n0other, Jan 3, 2006 IP
  3. t4vn.net

    t4vn.net Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you can uses java to do that.
    this is some code to do that :
    <script language="javascript">
    function link()
    {
    lk=new Array();
    lk=["http://www.yahoo.com","http://www.google.com","http://www.hotmail.com"];
    i=document.f.D1.selectedIndex;
    location.href=lk;
    }
    </script>
    and on HTML you call :
    <form method="POST" name="f" action="--WEBBOT-SELF--">
    <!--webbot bot="SaveResults" u-file="D:\web20\_private\form_results.csv" s-format="TEXT/CSV" s-label-fields="TRUE" --><p>
    <select size="1" name="D1" onchange="lienket()">
    <option>Yahoo</option>
    <option>Google</option>
    <option>Hotmail</option>
    </select><input type="button" value="Link" name="B1" onclick="lienket()"></p>

    good luck to you.
     
    t4vn.net, Jan 3, 2006 IP