html-select

Disable highlighting in an HTML SELECT box

I have a select box, <select multiple=true, that the user populates with values via a Picklist mechanism. I would like to disable highlighting in this box because, by definition, the values in this box are the selection. Just to clarify, I am NOT referring to text selection, which is what ::selection operates on. I'm talking about the u...

Checking for existence of an option with certain text

I'm trying to use jQuery to check for the existence of an <option> that contains a particular string of text. My attempts so far are not working as I expect. Here's the HTML: <select> <option value="13">General</option> <option value="3">Innovation</option> <option value="8">Marketing</option> <option value="9">Operation...

Set width of dropdown element in HTML select dropdown options

I am working on a website that involves automatically populating a select box using a PHP script. This all works fine except the problem is that what I am using to populate the text box have very long titles (they are journal articles and presentation titles). The dropdown box extends to the width of the longest element, which stretche...

Non framework implementation of a hierarchical drop down for Firefox.

I need a hierarchical drop down <select><option/></select> for use within a browser, preferably Firefox. I'd rather not use a framework like jQuery. Please spare me the questions as to why. ...

jQuery getting selected options issue

I have 2 multi-select boxes that transfer to each other. The transfer both ways goes fine. I also call an ajax fn to submit the selected options to a database. The call from left to right works fine because I am just getting all the options, not just selected ones. var domelts = $('#imfavs option'); // next translate that into an array ...

Several simple select boxes to replace a multiple select box in HTML

I'd like to replace a multiple select box like: <select multiple="multiple" name="options"> <option value="option1">option1</option> <option value="option2">option2</option> ... </select> with an arbitrary number of simple select boxes: <select name="options1"> <option value="option1">option1</option> <option value="o...

jquery and setting range of values

I am trying to come up with a way using ajax and jquery to display a range of values for a select box. The first drop down has options that need to talk to a 2nd drop box and that is a range of numbers, I know how to set the value of a drop down to 1 value, but not how set the whole range. By default the dropdowns are being generated by ...

In Django form, custom SelectField and SelectMultipleField

I am using Django everyday now for three month and it is really great. Fast web application development. I have still one thing that I cannot do exactly how I want to. It is the SelectField and SelectMultiple Field. I want to be able to put some args to an option of a Select. I finally success with the optgroup : class EquipmentField...

Disable events triggered on HTML <SELECT> control

Is there a way to capture the events triggered on HTML controls before they are forwarded for default (generic) handling by the control itself. In my case, I want to prevent a element dropdown to open when a user clicks on the control. e.g. On this user click, OnClick() event gets fired and is handled by the default control which open t...

form elements behaving unusually inside a jquery thickbox

i am using jquery's thickbox plugin ( ver. 3) and inside it I want to place a form that will be submitted using $.post. But the form elements are not behaving as they should. For eg there is a select box <select name="priority" id="priority"> <?php for($i = 5; $i > 0; $i--){ ?> <!-- <input type="radio" cla...

Select control problem with Firefox when "size" and "style height" are specified

I have a problem with select listboxes under Firefox 3.5.6. When both the "size" attribute and "style:height" attribute are specified, the select control does not seem to process Page Up and Page Down key presses properly. They act strangely: first of all they scroll through the options one at a time, just like an arrow up or down key ...

Dropdown currentIndex onchange

there is a dropdown with 5 options. Currently,option 2 is selected.The user selects option 4 now.The onchange event gets fired which is caught in a JS function listening for onchange on the select. In the JS function, I can check easily the index of the option selected by the user using the selectedIndex property.However, I want to also...

Use the TAB key to navigate to HTML BUTTON or SELECT element in Mozilla Firefox.

How do I do it? I've tried setting the tabindex attribute to no avail. ...

How to get selected value of a html select with asp.net

I have code below: <select id="testSelect"> <option value="1">One</option> <option value="2">Two</option> </select> <asp:Button ID="btnTest" runat="server" Text="Test it!" onclick="btnTest_Click" /> I need to get selected options' value on postback. How can I do this with asp.net? ...

by jquery, set to option of html-select element selected atribude by text, not value

hello. I have a select element. <select class='cSelectType'> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> <option value="4">four</option> <option value="5">five</option> </select> i can by jquery set option value selected like this: $('.cSelec...

Select menu closes once you click on it

I create a <select> menu using Javascript then attach it to the page. But when I click on it, it closes immediately. Here's my code, I'm stumpped. var accounts = [ ['user1', 'password'], ['user2', 'passowrd'] ] function html(){ var button = '<a href="#" id="switchacc">Switch User</a>&nbsp;• &nbsp;'; $('a[href=search.ph...

Trouble pre-populating drop down and textarea from MySQL Database

I am able to successfully pre-populate my questions using the following code: First Name: <input type="text" name="first_name" size="30" maxlength="20" value="' . $row[2] . '" /><br /> However, when I try to do the same for a drop down box and a textarea box, nothing is pre-populated from the database, even though there is actual conte...

html select option tag closes itself due to a "/" character in the dynamic value (JSP, JSTL)

<select id="ordersSelect" class="drop-down" onchange="somemethod()"> <c:forEach items="${orders}" var="order" varStatus="orderStatus"> <option value="${order.id}"> ${order.publicId} </option> </c:forEach> </select> I have the above peice of code in a JSP page, that receives a list of Orders and each order has some information, the...

Dependent Dropdowns (Linked Selects) with single class (no other selectors)

I am trying to create multiple dependent dropdowns (selects) with a unique way. I want to restrict the use of selectors and want to achieve this by using a single class selectors on all SELECTs; by figuring out the SELECT that was changed by its index. Hence, the SELECT[i] that changed will change the SELECT[i+1] only (and not the previo...

jQuery & drop down menu hiding divs (or textareas)

Hi, I would like to have a drop down menu with jQuery show and hide the different divs (or textareas) below it. Here's my jQuerycode at the moment: $(document).ready(function(){ $('#edit1').hide(); $('#edit2').hide(); $("#page_selection").change(function(){ $("#" + this.value).show().siblings().hide(); })...