Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

popup menu style listbox

Status
Not open for further replies.

canajun

Programmer
Sep 28, 2002
57
CA
I posted this in the HTML,XHTML,CSS forum incorrectly, and found some help, but not really the answer I was looking for.

Here it is:

1 Jul 08 20:48
I have searched for something as simple as this, but with no luck.

I have a space constrained form, with several textfields that I want to populate with a DHTML popup..

I don't want the popup to open a new window, but show up on the form page..

This is to replace list boxes that take up too much realestate on the page.

Any help would be appreciated!

I received this help from vacunita, but it doesn't really do what I want:

vacunita (Programmer) 4 Jul 08 12:15
You can try to use Javascript and hide and unhide an absolutely positioned Div that contains whatever you need.

You can even have a list box in that div or make it scrollable if you need more space.

Code:
function myunhide(){
if(document.getElementById("popupdiv").style.display == "none" || document.getElementById("popupdiv").style.display == "" ) {

document.getElementById("popupdiv").style.display = "block";

  }

  else {

    document.getElementById("popupdiv").style.display = "none";

  }

}

and in your HTML you would have a div that contains everything you need

Code:
<div id="popupdiv" style="display:none;">
Insert all your stuff here
</div>

While this does exactly what it is supposed to do, what I want is a 'popup' menu like listbox that will show on the page when hovering over a textbox, and allow a selection to be chosen, and then the value written to the textbox...

Kind of like a calendar or color picker, only simpler, and baffling me.
 
I don't see how listboxes need to take more space than text fields, but does this address your needs:
 
Thanks for the link.. will explore the other scripts at the site.. perhaps my explanation is not clear enough.

The textfield holds a value 4 characters long, but since I desire a more lengthy description, the list box is actually about 25 characters long.

Thus, a popup menu (perhaps layer is a better term -- not in a new window or tab) is desired that the user hovers or clicks on the textfield, the layer becomes visible, and the user can point to the text description, and have the 4 character numerical value written to the textbox.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top