multi-select

HTML Mutli Select Not Posting Values Back to PHP

喜你入骨 提交于 2019-12-02 12:31:23
I have a select box in a html form that does not post values back to php. <select multiple='multiple' name='mydropdown'> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> </select> in PHP if I have a look at the $_REQUEST it returns a single value for the LAST selected value in the select box. What do I need to change or edit in order to get a array or list of selected items posted back so that I can handle the result in PHP? I would like to transform the select into a JQuery multi select box so if your answer could apply to JQuery select boxes aswell I

Multi select PHP

有些话、适合烂在心里 提交于 2019-12-02 11:50:15
<form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <select name="test[]" multiple="multiple"> <option value="one">one</option> <option value="two">two</option> <option value="three">three</option> <option value="four">four</option> <option value="five">five</option> </select> <input type="submit" value="Send" /> </form> <?php $test=$_POST['test']; if ($test){ foreach ($test as $t){echo 'You selected ',$t,'<br />';} } if($t=='one') $price1=12; if($t=='two') $price2=2; $total = $price1 + $price2; echo $total; When one & two are both selected i'd like the result to be 14. What is the best

Populating a second dropdown using ColdFusion, jQuery, and Ajax

折月煮酒 提交于 2019-12-02 11:15:41
问题 I have one dropdown that has 14 values. Depending on the value chosen, it'll query a SQL Server database and return some clients to display in a second dropdown. I want that 2nd dropdown to use the jQuery Multiselect Widget where each value has a checkbox to select. Here is what I last tried to do, and it just doesn't work. <form> <label for="lstTiers">Tier:</label> <select name="lstTiers" id="lstTiers"> <option value="1">Tier 1</option> <option value="2">Tier 2</option> <option value="3"

jqGrid Column Chooser dialog is resizable but when resized the inner contents are not stretched on resize

我的梦境 提交于 2019-12-02 10:33:07
问题 I am using jqGrid with ui.multiselect.js for column choosing and reordering. The dialog which comes up is resizable but when resized, the contents of the dialog are not resized. Do you have to hook into any event do the stuff? 回答1: You are right. Currently it's a problem in the column chooser. It's better to make some fixes in the code of the columnChooser method. Before all you can improve the situation with resizing by making some changes in the Column Chooser dialog after the dialog is

How to make bootstrap-multiselect invisible my default?

风流意气都作罢 提交于 2019-12-02 06:07:55
问题 I am using the bootstrap-multiselect plugin to make dealing with drop down menu easier. However, I am having an issue when trying to make the menu hidden by default. Basically, I have a check box, when this check box is check then I display the drop down men. And when it is unchecked the menu should become hidden. The check box is unchecked by default so I want the menu to be hidden by default as well. I tried to hide the menu using basic css code to my select menu like so: <select name="menu

Fatal error: Call to a member function toOptionArray() on a non-object in Magento admin

偶尔善良 提交于 2019-12-02 06:06:02
问题 When I click on Shipping Methods tab under Magento system->configuration->SALES tab I am faced with the following error: Fatal error: Call to a member function toOptionArray() on a non-object in D:\xampp\htdocs\magento\app\code\core\Mage\Adminhtml\Block\System\Config\Form.php on line 463 The most astounding thing is that this is a fresh installation of Magento. Can anyone tell me how can I remove this error? 回答1: Add to config.xml <global> <models> <stockindicator> <class>Namespace_ModuleName

Fatal error: Call to a member function toOptionArray() on a non-object in Magento admin

青春壹個敷衍的年華 提交于 2019-12-02 00:30:14
When I click on Shipping Methods tab under Magento system->configuration->SALES tab I am faced with the following error: Fatal error: Call to a member function toOptionArray() on a non-object in D:\xampp\htdocs\magento\app\code\core\Mage\Adminhtml\Block\System\Config\Form.php on line 463 The most astounding thing is that this is a fresh installation of Magento. Can anyone tell me how can I remove this error? Add to config.xml <global> <models> <stockindicator> <class>Namespace_ModuleName_Model</class> </stockindicator> </models> </global> Following this tutorial solve the problem => http://kb

Handling data from multiple select field

こ雲淡風輕ζ 提交于 2019-12-01 23:32:41
问题 I have a multiple select field designed as below: <select name="deductions[]" multiple="multiple"> <option>Option 1</option> <option>Option 2</option> <option>.......</option> </select> I want to get values from the above select field to db using php post.This is how I have done it <?php $deds=$_POST['deductions']; $deds_joined=join(',',$deds); $sql=mysql_query("insert into mytable(deduction) values($deds_joined)"); /*code continues*/ My interest is to get the deduction values to an array and

ListBox Shift-Click Multi-Select Anchor is not being set properly

China☆狼群 提交于 2019-12-01 22:06:38
问题 I’m at my wit’s end trying to figure this out. I'm experienced in WPF, but I've never seen anything like this. I have a ListBox that contains selectable ListBoxItems. Items in the list can be selected by mouse click or by using the up/down arrows. I’m using SelectionMode.Extended, so my list supports multiple selections. The problem: Clicking on an item in the list, then Shift-Clicking on another item selects the correct range of items like you would expect. Unfortunately, using the up/down

Is it possible to set limit in multiple selection dropdown list?

让人想犯罪 __ 提交于 2019-12-01 21:01:40
问题 I am using a multiple selection drop-down list in my site.This is working properly and we can select more than one options from that list.But I want select only 3 options from that list.Is it possible to set limit for that?? I am using the code from http://www.aleixcortadellas.com/main/2009/03/20/492/ 回答1: use jQuery and following click function, it will help $(document).ready(function() { $('#slectboxid option').click(function() { var items = $(this).parent().val(); if (items.length > 3) {