Drop down / login

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ant82
    New Member
    • Oct 2007
    • 2

    #1

    Drop down / login

    Hi guys I wonder if you can help me?

    I have a quite a few 'job search' sites and im in the process of building the main portal site. I have added a login form onto this portal site and was wondering if it is possible to have a dropdown list so my customers can select the site they wish to log into and then use the form to login?

    Code:
    <form action="http://mysite.co.uk/index.php" method="post" style="text-align: left">
    this is what i have on the form, is there anyway to change the form action depending on what they select from the dropdown?
    Sorry if this doesnt make any sence i am new to web development and am teaching myself so I dont know all proper terms to use etc
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    Best way to handle this is, using a JavaScript. Please try like this.
    [code=html]
    <html>
    <head>
    <script language="JavaS cript" type="text/javascript">
    function setAction(URL){
    document.login_ form.action=URL ;
    }
    </script>

    </head>

    <body>
    <form action="http://www.defaultURL. com/index.php" method="post" name="login_for m" id="login_form" >
    <select name="url_menu" onChange="retur n setAction(this. value)">
    <option value="http://www.defaultURL. com/index.php">www. defaultURL.com</option>
    <option value="http://www.anotherURL/index.php">www. anotherURL</option>
    </select>
    <input name="" type="submit">
    </form>
    </body>
    </html>

    [/code]

    Comment

    • ant82
      New Member
      • Oct 2007
      • 2

      #3
      Worked a treat thankyou very much :)

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #4
        Originally posted by ant82
        Worked a treat thankyou very much :)
        Welcome any time. good luck :)

        Comment

        Working...