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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pop up to for a checkbox list?

Status
Not open for further replies.

devondago

Programmer
Jan 22, 2003
38
0
0
US
I have a checkbox list that I want to create a pop up textbox for each item of my checkbox list.
<asp:checkboxlist id="comm" Runat="server" RepeatDirection="Vertical" AutoPostBack="false" RepeatColumns="2">
<asp:ListItem Value="Europe">Europe</asp:ListItem>
<asp:ListItem Value="North America">North America</asp:ListItem>
<asp:ListItem Value="South America">South America</asp:ListItem>
<asp:ListItem Value="Central America">Central America</asp:ListItem>
<asp:ListItem Value="Australia">Australia</asp:ListItem>
<asp:ListItem Value="Africa">Africa</asp:ListItem>
</asp:checkboxlist>
I have tried tooltip but it only lets you create a popup text for the entire control not for each listitem. Can someone make a suggestion so i can get this resolve..
thanks
 
I haven't tried this, but maybe you could add to each ListItem's attributes. Create a Div tag whose z-index is one more than your page (probably 0, so 1) that contained the text to "pop-up" for each option. Then use a javascript function that shows/hides that div and sets the text inside it to display. You will need to add the listitems in code so that you can add these extra attributes easily. Create each listitem and add it to the checkbox list in the Page_Load method, but not during postback.

Code:
Dim li as ListItem
li.Text="Europe"
li.Value="Europe"
li.Attributes.Add("onmouseover", "functionToShowDiv();")
li.Attributes.Add("onmouseout", "functionToHideDiv();")

comm.Items.Add(li)

'do the same for the rest of the items

Greetings,
Dragonwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top