option

rails: add a attribute to a option tag through collection_select

Hello everybody, I have a collection_select: f.collection_select(:selected_id, @subcategories, :id, :cat_transl) which turns into the following tags: <option value="4">Deutsch</option> <option value="5">Chinesisch</option> <option value="6">Spanisch</option> <option value="10">Mathematik</option> What I want is to add a attribute ...

load text file list into <option> tags

Im working on a PHP project that involves selecting a song, hitting the submit button and then having the PHP loading the song player to the correct option. anyway: for the song selection I want to load these options from a txt file with the following formatting: All For Love Break Free Come to the River For You Name which I want to...

How to make <option>s of <select> show or hide using javascript?

I want to make the options of < select > show or hide by program(JS),is it possible ? it just like the interesting tags in the front page of StackOver Flow,when you type in some words,the drop list will expand and give you suggestions. ps.I know StackOver didn't use select in this case,anyway,just take it as an example. ...

Why is there one of my select options that put nothing in the query string at form submission?

This is my html: <select name="results"> <option value="0">Vis alle</option> <option value="10">10 resultater per side</option> <option value="20">20 resultater per side</option> <option value="30">30 resultater per side</option> <option value="40">40 resultater per side</option> <option value="50">50 resul...

Jquery detect when user uses SELECT element in form

Hello, I want to be able to detect when the user has selected an option from a SELECT element in a form. I know what to do from there, but not sure about how to achieve the initial detection. <select id="mySelect"> <option>1</option> <option>2</option> <option>3</option> </select> I would like the solution in JQuery if po...

Hide option elements in select dropdown and IE6

I wrote some jQuery code to .hide() an <option> element in a select dropdown. .hide() is what I want, because later I can call .show() and the options will not need to be resorted, since the now visible option element will not have changed positions. .hide() worked great in FF/Chrome, but not in IE6/7/8. So my thought was to write mor...

I want to push a selected value into a select/option dropdown

I want to select a value in a select/option dropdown using javascript only. Revised sorry for confusion. Here is revised code. document.getElementById("sel_activity").value = activity; This will also work, but is a bit longer.. <select id='sel_activity'> <option value='CYC'>Cycle Count</option> <option value='INV'>Inventory Count</o...

carry some extra information in an HTML select/option dropdown list

I want to carry some extra hidden information (eg: postal code) in an HTML select/option dropdown list and make it available to a javascript function when user changes option box selection. This is the type of thing I would like to do (but alas it does not work). Can someone fix it or suggest reasonable alternative? <select id="s...

not working IE8 if option value selected switch css

i know there is probably a better way of doing this, i have tried many ways. i would normally do the .hide() or .show() but the css display switch has been working better on FF, not on IE. anyway here is my code $(".VariationSelect option[value='21']").click(function () { $("#21").css("display", "block"); }); $(".VariationSelect opt...

If-clause in a foreach loop at Smarty-template-system

I use Smarty as a template system in a script of mine. There is a page with drop-down-boxes (to select a music genre) and the form is reloaded with an on-change event. The value of the drop-down-boxes are transfered via GET. The drop-down-boxes should have the value selected before. The PHP-Code concerning the GET code is $get_ge...

Where is the filter for configurable products while caching layered navigation attributes?

I need to locate the code, where layered navigation filter (options) are build... It seems these options only come from config. products which are visible in catalog and search, but i need to change this behaviour to a new visibility state... ...

dynamic struts <html:option>

hi expert, how to write dynamic struts , i'm doing as below <logic:iterate id="data" name="sendEmailForm" property="eventList"> <html:option value="<bean:write name="data" property="eventId"/>"/> <bean:write name="data" property="title"/> </html:option> </logic:iterate> but getting error JSPG0069E: Unmatched end tag f...

HTML Select returning user-visable text not value field

I am having an issue with a SELECT tag in an HTML form on an ASP page. This will have varying numbers of options under it, and is generated dynamically from a database. Code below; <select name='select1' id='select1' size='10'> <option value="12345678901234567890">User-Friendly Text 1</option> ... <option value="100000393737...

tkFileDialog.askopenfilename How to specify a different drive?

I'm using "tkFileDialog.askopenfilename" to get a file name variable. I know that I can set the "initialdir" option, but not everyone who uses the program will have the target file on the same drive. For example: the file could be located on the C:, D:, E: etc... I don't see a way to view available drives with the dialog box they have op...

How to set selected value to multiple Select inputs with jQuery?

Hi, I have 2 select inputs and I filling them with an array of years. After that I want to set currentYear the selected value for every Select. I hacve this code but only works with first Select I don't understand why. EDIT 2 Everything works great with jQuery 1.4.3, 1.4.2 fails :_( EDIT I'm trying this without success :-( only fisr...

trigger('change') selects the 1st option, which I don't want

I have a select that has several options. No empty option. Before calling the trigger none of the options are selected, after it runs the first option is preselected, and I want that the select to stay as it was, no option selected $("#selProduct").trigger('change'); How to fix this? I still want to trigger the change, to run the eve...

Javascript: Remove different option-tags from a dropdown list depending on another dropdown?

Yeah, the title is a mess. Here's what i'm trying to do: I have one main dropdown list where i can choose between, let's say, two options. Option1, and Option2. If Option1 is selected, i don't want anything to happen. If Option2 is selected, i want to remove one option-tag from another dropdown list. <select name="main_dropdown"> <...