Formerly Best Training
© 2024 STL. All Rights Reserved.
All prices offered for business users and exclude VAT. E&OE
2nd Floor, CA House, 1 Northey Street, Limehouse Basin, London, E14 8BT. United Kingdom
Forum home » Delegate support and help forum » Dreamweaver Training and help » courses-dreamweaver - Importing a list to a form
Resolved · Low Priority · Version Standard
Gavin has attended:
Dreamweaver 8 Introduction course
Dreamweaver 8 Intermediate course
how do i import a list to a form, instead of having to manually type it in?
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
|
Dreamweaver tip:Creating line breaksIf you want to create a line break hold down Shift+Enter. |
We'll call during UK business hours
Server loaded in 0.08 secs.