Adding a list menu or dropdown menu to a form.

A list menu or dropdown menu is a list where you can select a value.
Example: Selecting a theme in Microsoft Windows.

We use the same example:
First Name
Last Name

and we add Country as a dropdown menu.

The dropdown menu contains of:
<select>?<option>?.</option>?</select>

First create the select tag:
<select name="name_of_selection">
</select>

Inside the select tag we have the option that can be selected.
<option value="option_value">Option 1</option>

Remember that it is the option value that being submitted and the text entered between <option>?</option> tags are displayed on the screen as selections.

In your option list you can use selected (only one time), to select an option in the list.
Example: <option value="China" selected>China</option>
 
Here are or two forms containing a list or dropdown menu.

form1.cfm

<form action="form2.cfm" method="post" name="form1">
First Name:<input name="first_name" type="text" size="20" maxlength="20">
<br>
Last Name:<input name="last_name" type="text" size="20" maxlength="20">
<br>
<select name="country">
  <option value="Afghanistan">Afghanistan</option>
  <option value="Albania">Albania</option>
  <option value="Bahamas">Bahamas</option>
  <option value="Belgium">Belgium</option>
  <option value="Canada">Canada</option>
  <option value="China" selected>China</option>
</select>
<br>
<input name="upload_person" type="submit" id="upload_person" value="Submit -->">
</form>

 

 

 

 

 

 

 

 

form2.cfm

First Name: <cfoutput>#Form.first_name#</cfoutput>
<br>
Last Name: <cfoutput>#Form.last_name#</cfoutput>
<br>
Country: <cfoutput>#Form.country#</cfoutput>

 

Advertisement

Pingo Banner rate drop

No User Comments.

No User Comments, be the first one to write your comments?

ApplayIT is owned by Scandic Systems LTD [UK] Company No. 5984000. All other trademarks and copyrights are the property of their respective holders.