Drop-down menu with a good form

Source: Internet
Author: User
Tags key
Menu | Pull <select> tag You can easily insert a drop-down menu in a form to make it easy for users to choose from, which is useful when making questionnaires or user orders, and a little makeover of this Pull-down menu allows you to make a truly Drop-down navigation menu.

One, drop-down selection box


These two examples have different appearance forms, but they are all made with the <select> and <option> tags, but they are set up with various parameters. By comparing their source code, you'll see:
Menu source code on the left:
<select name= "Select" size= "4" multiple>
<option value= "1" selected> Select Travel route </option>
<option value= "2" > Huangshan 2nd Tour </option>
<option value= "3" > Huangshan Essence Tour </option>
<option value= "4" > Huangshan Boutique Tour </option>
<option value= "5" > Huangshan 4th Tour </option>
</select>
To the right drop-down menu code:
<select name= "Select2" size= "1" >
<option value= "1" selected> Select Travel route </option>
<option value= "2" > Huangshan 2nd Tour </option>
<option value= "3" > Huangshan Essence Tour </option>
<option value= "4" > Huangshan Boutique Tour </option>
<option value= "5" > Huangshan 4th Tour </option>
</select>
As you can see from the source code above, all the <option> tags of the two menus have the same parameter settings, but the left menu is set size= "4" in the <select> tag so that it can display four menu items at a time. In addition, it sets the multiple parameter so that multiple items can be selected on the menu, and the SHIFT key is pressed when multiple items are selected.

Second, the production of navigation menu


This example looks like the previous example does not make any difference, but when you use the mouse to point out the pull out of the menu item, but can link to the corresponding page, that is, it is a veritable drop-down navigation menu, first look at its source code changes:
<select name=d1 size=1 >
<option selected value= "Cun Fu Station Navigation" > Village Station Navigation </option>
<option value= "Http://go.163.com/~fym888/home.htm" > Village husband </option>
<option value= "http://go.163.com/~fym888/dwyd.htm" >DW Garden </option>
<option value= "http://go.163.com/~fym888/flashyd.htm" >flash Garden </option>
<option value= "http://go.163.com/~fym888/pageabc.htm" > Web page abc</option>
<option value= "http://go.163.com/~fym888/download.htm" > Article download </option>
</select>
As you can see from the code above, the value of values is different from the previous example, no longer a number, but a Web page URL address, so once you select a menu is equivalent to a Web page address, but only the web address is not enough. In this case, the key is this line of code: The function of this code is that once the selection changes, immediately get the address of the page from the currently selected menu, and link to this address, thus ensuring the navigation function implementation.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.