Hello,
I would like to create an ordered list in a text area named textfield. Every time someone clicks on a link, I’d like it to add the link name to textfield1 in an ordered list. i.e. A) ? C) D)
[CODE]
function addMsg(text,element_id) {
document.getElementById(element_id).value += text + ‘n’;
}
[code=html]
<A HREF=”#” onclick=”addMsg(‘You clicked on Link1′,’textfield’); return false;”>Click on Link 1</A>
For example, if you “Click on Link 1” 5 times, it will add this to the text area:
A) You clicked on Link1
? You clicked on Link1
C) You clicked on Link1
D) You clicked on Link1
E) You clicked on Link1
Then, if you deleted line C), it will automatically relabel to:
A) You clicked on Link1
? You clicked on Link1
C) You clicked on Link1
D) You clicked on Link1
Then, if you “Click on Link 1” again, the text area will again show
A) You clicked on Link1
? You clicked on Link1
C) You clicked on Link1
D) You clicked on Link1
E) You clicked on Link1
Is this possible?
The reason I want to do it is because I want users to be able to edit the text within the textarea, and copy and paste easily. Otherwise a list box would make more sense. Can’t do HTML in a textarea.. though?