How to Create a Drop Box for My Web Page

Creating a drop down selection box on your web page is accomplished using simple HTML code. You'll need to create a form on your page, then add the appropriate code for the drop down list.

Things You'll Need

  • Text editor
Show More

Instructions

    • 1

      Create the start of an HTML form by typing in this code: <form action="myform.php">

      The "myform.php" action can be named whatever you'd like, and it must be a script that exists on your web server that can do something with the form data you send to it.

    • 2

      Create your drop down box by inputing in this code: <select name="color">

    • 3

      Repeat this line as many times as needed, replacing each entry with the text you want showing in your drop box: <option value="red">Red</option>

      To add blue and green as additional options, for example, you would add the following two lines:
      <option value="blue">Blue</option>
      <option value="green">Green</option>

    • 4

      Close the drop down list by typing this code: </select>

    • 5

      Close your form by typing this code: </form>

Tips & Warnings

  • Forms and drop down lists will not do anything unless you are sending the form data to a script on your web server.

  • Normally forms are made to collect data for specific use, such as adding someone to a mailing list, sending them to a specific area of your web site or allowing them to order products. The forms themselves are made in standard HTML as outlined above, however, the data is not actually processed with a form. For that, a programming script is required.

  • Programming scripts reside on your website server, and are used by forms and web pages to do specific things. A mailing list form for example, would need a mailing list script to actually receive the form data and put it into a database.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured