Results 1 to 2 of 2

Thread: Form Drop List

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    110

    Form Drop List

    Basically I was wanting to write something to select a language that would then forward you onto the specified page. But I was wondering if I could use a function for the language or something so it could forward me to the next page. As you can see below, I tried writing a function in PHP and Javascript using the switch statement but nothing is seeming to work.

    Code:
    <html>
    <head><title>Welcome To The WCG Tour Registration</title></head>
    <body>
    <center>
    
    <form name="form" action=getpage() method="POST">
    <table align="center" width="100" height="200">
    <tr><td><select name="language">
    <option value="English">English</option>
    <option value="Spanish">Español</option>
    <option value="Portugese">Português</option>
    <option value="Japanese">日本語</option>
    <option value="French">Français</option>
    <option value="Korean">한국어</option></td>
    </select>
    <td><input type="submit" value="Submit"></td></tr></table> 
    </form>
    <font color=white size=3 face=Verdana>Please select a language, if you do not see a 
    
    language that applies to you, you do not qualify for this tournament.</font>
    </center>
    
    </body>
    </html>

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    You action attribute in the form needs to be an address of the page you are submitting the infoamtion to. If you want to apply a function before submitting the form you should use the forms on submit event.
    Code:
    <form id="formlanguage" action="nextpage.php" onsubmit="getpage()" method="POST">
    Ideally you'll want to do as much in PHP as possible. Have the nextpage.php page select the appropriate lanaguage, rather than Javascript.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width