On Feb 27, 1:14 pm, secndChildh...@yahoo.com wrote:
I hope someone can help with this problem:
I have a perl cgi form that has a popup_list. Based on a value that
"popup list"? I think you mean select element.
is coming in from a database query, I want to either
1) display the value (from the databse) and let the user change it;
OR
2) display the value (from the database), but NOT let the user change
it.
I tried using javascript to disable the popup list, and that works,
except the form "loses" the value of the entry in the popup list.
Maybe "disable" is not the correct property I want to use. If that is
the case, what is it?
If you meant input element, you are after the readonly property - it's
an HTML feature, not javascript.
<URL:
http://www.w3.org/TR/html4/interact/...#adef-readonly >
If you mean that you have a select element and you want to set the
selected option and either:
1. let the user change the selected option, or
2. prevent the user changing the option.
1. can be achieved by setting the appropriate option's selected
attribute in the source HTML, or using script to set the select's
selectedIndex property to the appropriate value, or setting the
appropriate option to selected=true.
2. can only be reliably achieved by removing all the other options.
--
Rob