Edit an <option> tag?

S

Sims

Hi

Any help would be greatly appreciated.

consider the code

<SELECT NAME="number">
<OPTION VALUE="1">This is 1
<OPTION VALUE="2">This is 2
<OPTION VALUE="3">This is 3
<OPTION VALUE="4">This is 4
</SELECT>

I want to add an item that the user can edit

<SELECT NAME="number">
<OPTION VALUE="0"><please enter your text>
<OPTION VALUE="1">This is 1
<OPTION VALUE="2">This is 2
<OPTION VALUE="3">This is 3
<OPTION VALUE="4">This is 4
</SELECT>

So that the user can either select items 1 to 4 or edit a new value.

Can it be done in html? I want it to be available to most browsers so it
must be fairly standard.
If there is no way of achieving the above what would be an elegant way of
doing it?

Many thanks
Simon
 
J

Jukka K. Korpela

Sims said:
I want to add an item that the user can edit

In HTML, you cannot. You can just have a select element and in
input type="text" element, and resolve the issue in the form handler.
You might consider adding JavaScript that initially hides the input
field and makes it visible and functional when a particular selection
is made in the select element. More on this:
http://www.cs.tut.fi/~jkorpela/forms/combo.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top