By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,272 Members | 1,454 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,272 IT Pros & Developers. It's quick & easy.

disable=true

P: n/a
I hope someone can help with this problem:

I have a perl cgi form that has a popup_list. Based on a value that
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?

Thanks,
Shirley

Feb 27 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

Feb 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.