/    Sign up×
Community /Pin to ProfileBookmark

IE disable select

I have a select box that I use primarily for view only. It displays a database populated list of email addresses for the user. I do not want them to be able to select the items in the list because it gives them the false sense that they can do something with these addresses.

So I set the select to disabled and all is fine in Mozilla/Netscape. Problem it now in IE the user can not scroll down (it is disabled) to see all of the email addresses in the list if they go beyond the window. How can I correct this?

Thank you ahead for any help.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@AdamGundryMay 02.2003 — Why not simply display the addresses in a non-selectable scrollable element such as an iframe or div?

Adam
Copy linkTweet thisAlerts:
@tripwaterauthorMay 02.2003 — I have never done that before....newbie. I am populating the select with a while loop from a DB query. can I still do this with the divs and set a limit on the size? There can be a large or small number of addresses from the query so I need to make sure it is not go off the page...contained. My code is below,

********PHP**********

<select size=10 style=width:300>";

while ($row = mysql_fetch_array($result))
{
$value .= "<option>".$row[0];
}

$value .= " </select>



How would I do this with <div>? I know that iframe is not supported in some browsers. My solution has to work across IE,Netscape,Mozilla. Thanks again.
Copy linkTweet thisAlerts:
@AdamGundryMay 02.2003 — Replace your <select> code with something like this:

<div style="width: 100px; height: 100px; overflow: auto">

That should give you a fixed 100px square <div> which will use scrollbars to display content when required.

You can always put this CSS in a seperate class, and might want to relatively size the div. If you want the scrollbar to be always present, use overflow: scroll.

Adam
Copy linkTweet thisAlerts:
@tripwaterauthorMay 02.2003 — thank you very much
×

Success!

Help @tripwater spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...