List Field, the correct way please

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Raidersguy
Posts: 18
Joined: Thu Aug 17, 2006 9:30 pm

List Field, the correct way please

Post by Raidersguy »

Write your message below:

Could someone please tell me the correct way to add a list field, in a standard html a list field would look something like:
<select name="whatever" size="2" id="whatever">
<option>first choice</option>
<option>Second choice</option>
<option>Third choice</option>
</select>
This works but you cant change the colour of background of the text box.
So I assume I have this wrong.
Any help please.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello Raidersgue,

This is not the forum for that kind of questions.
For help on html and other web related languages i often use http://www.w3schools.com/

But here's my answer:

<form>
<select name="whatever" size="2" id="whatever">
<option value="1">first choice</option>
<option value="2">Second choice</option>
<option value="3">Third choice</option>
</select>
</form>

In words:
The select tag has to be inside a form.
The option tag has to be assigned a value.

For the background color use

Code: Select all

select {
   background-color:red;
}
Greetings,
Henrie
Raidersguy
Posts: 18
Joined: Thu Aug 17, 2006 9:30 pm

Post by Raidersguy »

Hi sorry but it is for the guestbook as I have added another field, my fault I know I didn’t say, I’ll try that, many thanks.
Post Reply