20
голосов
7ответов
75384 просмотров

Zend Framework - Set 'selected' value in select box dropdown list

I am adding a select element to a Zend_Form instance as follows: $user = $form->createElement('select','user')->setLabel('User: ')->setRequired(true); foreach($users as $u) { if($selected == $u->id) { $user->addMultiOption($u-&gt...

0
голосов
1ответов
591 просмотров

Select element: Short and Long names without javascript?

Is there a non-javascript method to allow a element to show short display text when collapsed and longer text when expanded? I came across the "label" attribute for but it is only supported in IE7+. Example: The expanded menu would display: Philosophy 101 Religious Studies 202 Intro to Medi...

0
голосов
2ответов
2046 просмотров

Change HTML-select element value with mousewheel in Firefox

Is there any possibility to tell Firefox to use the mousewheel für scrolling through the select element. In firefox after selecting another value the select element looeses its focus, and in IE it doest loose its focus, so if i use my wheel the onchange event is fired. Try here. Is there any so...

0
голосов
1ответов
1005 просмотров

creating a select element via js, focus doesn't work in IE

I'm a newbie in js and I'm afraid that i haven't the knowledge to resolve the next issue. If I have a select element ( populated with several options ) already parsed by the browser on the load, the next code works just fine in both IE and FF $('selectId').focus(); but if I create ( and popul...

1
голосов
3ответов
3679 просмотров

Why does Classic ASP Post a Multiple Select List with a space between values where ASP.Net doesn't?

I have an old Classic ASP code such as: <html> <head></head> <body> <form action="test.asp" method="post" name="fname"> <select name="clients" size="3" multiple="multiple"> <option value="5311" selected="selected">5311</option> <op...

2
голосов
2ответов
7632 просмотров

some jQuery/javascript help. Add items to optgroup

I have an array called tmp var tmp = ["05", "13", "27"]; if an option value is equal to a value within tmp, I want to add that option to a particular optgroup, else add it to the other optgroup. I keep getting everything added to optgroup #2, except the option with the value "27". What am I doi...

1
голосов
4ответов
3833 просмотров

Select option always select

I have a select options form fields setup like below: <select name="options[]" multiple="multiple"> <option value="1" selected="selected">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> <option value="...

0
голосов
2ответов
1225 просмотров

Why is my HTML Select box in Opera Browser not behaving?

I have a simple select element on my page: <select id="info_routes" size="10"></select> This select box gets populated at page load via jquery at document ready: for (var route in _routes) { var val = _routes[route].id; var key = 'route_'+val; $("<option />").attr(...

0
голосов
1ответов
304 просмотров

multiple select values error

I have a form that allows the user to select up to X amount of options from a multi-select field. If the user selects an item greater than the X items it prompts and de-selects the last selected item. There is an issue when the warning message has been thrown by a previous multi-select. Th...

16
голосов
2ответов
26679 просмотров

jQuery: add an <option> to a <select></select> </option>

When I attempt to add an option to a select, the option I’m trying to append ends up appended to the first option instead of the select itself. $(".ct [value='']").each(function() { $(this).append($("&lt;option&gt;&lt;/option&gt;").attr("value", "Reset").text("Reset")); }); Help?

229
голосов
8ответов
438932 просмотров

jQuery remove options from select

I have a page with 5 selects that all have a class name 'ct'. I need to remove the option with a value of 'X' from each select while running an onclick event. My code is: $(".ct").each(function() { $(this).find('X').remove(); }); Where am I going wrong?

0
голосов
1ответов
886 просмотров

OnChange problem with select_tag with '/' and '.' characters in Rails

I have an select_tag (rails) that loaded a select value with '/' and '.' character in it. The select tag's onchange redirects the page (using window.location) using concatenated url with the value of the select tag. These are the things I tried to isolate the problem. Invokes alert javascript...

2
голосов
8ответов
9451 просмотров

<div> and <select> tags</select> </div>

Can I have a &lt;DIV&gt; within an HTML &lt;SELECT&gt; tag? e.g.: &lt;select tabindex="2" name="agegrp" id="agegrp" &gt; &lt;div&gt; &lt;option value="-1"&gt;No preference&lt;/option&gt; &lt;/div&gt; &lt;/select&gt;

3
голосов
2ответов
6993 просмотров

Jquery - issue with click event on Select dropdowin in IE6

I am having an issue with a jquery function. It works in FF but not in IE 6. I want the function to be triggered when any option inside a select drop down is clicked. Here is the start of my funcation: $('#titleSelect option').click( function() { alert("title clicked"); ...... });...

8
голосов
1ответов
24877 просмотров

Using Selenium for selecting an option on a select with optgroup

I'm trying to select a value in a select element. I'm using Selenium RC (Java) to run the test cases. I understand that the code for selecting a value is given by: selenium.select("locator", "value=REQUIRED VALUE") I'm unable to select the desired value with the above code. I think it might be...

2
голосов
4ответов
5333 просмотров

JavaScript: get value of dropdown

I have 3 HTML combo/drop down boxes. All of them have a distinct name and id. On a particular event I want to get the value of all three of them. Can any one give me a code snippet for that?

0
голосов
4ответов
260 просмотров

Where does the extra empty <option> come from?</option>

&lt;?php $salaries = array(1000,1500,2000,2500,3000,4000,5000,6000,7000,9000,12000,18000,30000); $str = ''; foreach($salaries as $salary) { $str .= "&lt;option value=\"$salary\"&gt;$salary+&lt;/option&gt;"; } function populateSalary() { $salaries = array(1000,1500,2000,2500,3000,4000,500...

5
голосов
3ответов
28239 просмотров

Changing URL through html select

What is the best way to change your URL through an html select? &lt;select&gt; &lt;option selected="selected"&gt;Change to URL X&lt;/option&gt; &lt;option&gt;Change to URL Y&lt;/option&gt; &lt;/select&gt; What Javascript should be used?

0
голосов
3ответов
5836 просмотров

how can we remove an item from SELECT list whose SIZE is not declared

How can we remove a selected item from SELECT whose SIZE is not declared, means acting as drop down list. using javascript

4
голосов
6ответов
4963 просмотров

html select tag problem

enter code herei am using the folllowing code . I wnat that the only single option is selected. but right now its showing some other options as selected by defaul when the page loads. How can i make one particular of my choice o selected? &lt;select name="ms"&gt; ...

0
голосов
1ответов
1429 просмотров

Adding options to SELECT tag via JS ..Are not styled by CSS?

I have a select tag that looks like this: &lt;select style="background:#fa7171; color:#FFFFFF;" name="product_type_sub" id="product_type_sub" onChange="ajaxFunction(1);"&gt; &lt;option value="None Selected"&gt;None Selected&lt;/option&gt; &lt;/select&gt; You can see the inline css sayin th...

1
голосов
2ответов
8868 просмотров

Selecting a default value in a <select> statement in a XSL file</select>

I have a list of items like how its listed below, and I'm trying to get that option selected by default which has a certain tag within the "listing" tag. &lt;select&gt; &lt;xsl:attribute name="name"&gt;&lt;xsl:value-of select="@id"/&gt;_type&lt;/xsl:attribute&gt; &lt;option&gt;&lt;xsl:attribute...

0
голосов
2ответов
412 просмотров

Not able to pass value from a select list in a simple crud form?

I have written a simple CRUD form which has one select list. However the value from the select list doesnot seem to get passed to the database. it get passed when I am using a simple text box. What is the possible error? Please point out &lt;?php include('config.php'); if (isset($_POST['submitte...

1
голосов
3ответов
4443 просмотров

PHP - Pass Drop Down List option through query string

I have a drop down list that has options that need to be passed through a query string. How would I go about doing this? Also, would anyone be able to list a way to do this both using a button and without using a button? Thank you!

2
голосов
5ответов
8276 просмотров

How to get selected value after clone with jQuery?

Here is my complete testing code,which failed to get the value: &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"&gt; &lt;head&gt; &lt;meta http-equiv...

0
голосов
2ответов
793 просмотров

jquery plugin for dropdown from select or list

I need a lightweight jquery plugin to build up a dropdown. I need this to work with both a source or , this could be one or two separate plugins. The dropdown displayed needs to display the contents in multiple columns - I've only seen one plugin do this (http://www.givainc.com/labs/mcdropdown_j...

1
голосов
2ответов
506 просмотров

jQuery triggers in a form

I previous recieved help with a problem, getting a multiple option select form to create new inputs, depending on how many were selected. The code below is what ended up working for me (credit goes to Peter Bailey) &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/...

3
голосов
2ответов
2194 просмотров

Disable or ignore mousedown on select field in firefox

Is there any way to make it so a click on a select input field does not open the list of options? I tried returning false from onmousedown and onclick, I tried calling this.blur() in onfocus, I tried setting the readonly attribute, none of this seems to work in Firefox. Chrome and IE seem to tak...

58
голосов
10ответов
267532 просмотров

Setting the selected attribute on a select list using jQuery

I have the following HTML: &lt;select id="dropdown"&gt; &lt;option&gt;A&lt;/option&gt; &lt;option&gt;B&lt;/option&gt; &lt;option&gt;C&lt;/option&gt; &lt;/select&gt; I have the string "B" so I want to set the selected attribute on it so it will be: &lt;select id="dropdown"&gt; ...

0
голосов
3ответов
1062 просмотров

Selecting Multiple Options creates Multiple Inputs

I have a select field in a form that allows you to select multiple options. I need to create a new input textbox for every number of options selected, automatically. For example, if you select on option in the select box, one input will appear below it. If you select 5, 5 inputs will appear be...