Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

STL - Formerly Best Training Solutions Through Learning
TrustPilot
Excellent
Request Callback We will call you back
0207 987 3777 Call for assistance
Your Basket Basket is empty
courses-dreamweaver - importing list form

Forum home » Delegate support and help forum » Dreamweaver Training and help » courses-dreamweaver - Importing a list to a form

courses-dreamweaver - Importing a list to a form

ResolvedVersion Standard

Gavin has attended:
Dreamweaver 8 Introduction course
Dreamweaver 8 Intermediate course

Importing a list to a form

how do i import a list to a form, instead of having to manually type it in?

RE: Importing a list to a form

Hi again Gavin,

If I had a long list of items to put in a selectbox element, I'd paste the items into the code view, then either use some kind of macro or just copy and paste the <option> tags around each item.

For example, the selectbox (or list) in HTML code starts and ends like this:
<select name="elementname">
</select>

And between these Select opening and closing tags you put an opening and closing Option tag for each item.

So if, in Code view, you pasted in your list of items (from word, excel, or anywhere) you would then have this:
<select name="elementname">
Orange
Apple
Banana
Peach
</select>

You then need to go and put <option> before each item, and </option> after each item. So either copy and paste them in for each row, or if you have many items, perhaps use a program like UltraEdit, which can do text macros on every line of a text file. eg. you specify to put the text <option> at front of each line, and </option> at the end.

And that's all a select box is.

Note, an optional parameter in the nested <option> tag is value="". This parameter specifies the actual data that gets sent back to the web server. If you don't specify a value parameter, the server assumes the value is the same as the label (what the visitor sees).

eg.
<option value="orange">orange</option> is the same as <option>orange</option>

whereas
<option value="blueberry">orange</option> would send 'blueberry' to the server, even though your visitor selected 'orange' from the list.

Hope this has helped.

Regards, Rich

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.