drop-down-menu

Cascading Combo box HTML

旧时模样 提交于 2020-01-11 11:21:48
问题 I am not really a web person and am having trouble creating a cascading combo box. I have my options, but when I cannot figure out how to do a JavaScript command to switch the second box depending on the first box's selection. These are my first set of options: <select id="searchType" onchange="selectedOption(this)"> <option value="sessions">Sessions</option> <option value="files">Files</option> <option value="clients">Clients</option> </select> Depending on what they click there I would like

Cascading Combo box HTML

孤人 提交于 2020-01-11 11:19:28
问题 I am not really a web person and am having trouble creating a cascading combo box. I have my options, but when I cannot figure out how to do a JavaScript command to switch the second box depending on the first box's selection. These are my first set of options: <select id="searchType" onchange="selectedOption(this)"> <option value="sessions">Sessions</option> <option value="files">Files</option> <option value="clients">Clients</option> </select> Depending on what they click there I would like

Using an HTML drop-down menu with Google Apps Script on Google Sheets

混江龙づ霸主 提交于 2020-01-11 09:26:13
问题 I am running a function on Google Sheets that requires a user to pick from a (rather lengthy) list of options. As UI service is deprecated, I thought I'd try with HTML, but I know nothing about this. I need the HTML User interface to pop up, have the user pick a name from the list, then go away, after passing the name back to the apps script function. I have tried to cobble together some code, but I can't seem to always get the drop-down menu to pop up, and I just can't seem to figure out how

Add option selected disabled in PHP

不问归期 提交于 2020-01-11 06:57:10
问题 I have a form with a dropdown field in PHP with this array: $field["options"] = array( array("value" => "Chişinău", "text" => "Chişinău", "depth" => 0), array("value" => "Bălţi", "text" => "Bălţi", "depth" => 0), array("value" => "Comrat", "text" => "Comrat", "depth" => 0), ... array("value" => "Ungheni", "text" => "Ungheni", "depth" => 0) ); How to add as a first option the <option selected disabled>Choose one</option> ? 回答1: $field["options"] = array( array("value" => " ", "text" => "Choose

codeigniter - dependent dropdown with jquery and ajax post

断了今生、忘了曾经 提交于 2020-01-11 03:07:07
问题 view : learning_view.php Here is the first dropdown which I am populating from database. <select name = 'category' id = 'category'> <option value="">-- Select Category --</option> <?php foreach($category as $item){ ?> <option value="<?php echo $item->id_cat; ?>"><?php echo $item->name; ?></option> <?php } ?> </select> <br><br> What I want is to populate another dropdown which is dependent on the first dropdown. For that I have used the jQuery ajax post. second dropdown: <select name = 'type'

Show ajax based elements after form submit error

大城市里の小女人 提交于 2020-01-10 05:38:06
问题 I have two select elements in my form, Category and Sub-category. At first, only the category select is shown. When the user makes a selection in the category select, an AJAX request is sent to the server and the subcategory select is shown. It works fine. Now, when there is some error in the form submit, due to anything, missing some value that is required, or anything, I show the error message, but I cannot retain the same state of the select boxes, I see only the category select, with no

Hide option from dropdown 2 when selected in dropdown 1

假如想象 提交于 2020-01-10 03:25:10
问题 I have two dropdowns, both have the same items in them. If an option is selected in dropdown 1 then I would like to hide that option in dropdown 2. When it is unselected in dropdown 1 I would like it to appear again in dropdown 2 and whichever option is then selected to then be hidden in dropdown 2. I am trying to have this exclude the blank option in the first index. Here is a codepen that I started, but I am not sure where to go from here: http://codepen.io/cavanflynn/pen/EjreJK var

Customize divider / separator in dropdown of an AutocompleteTextview

那年仲夏 提交于 2020-01-10 01:04:08
问题 I've seen this question asked some other times on the site, but no one couldn't get any answer. Is there any way to customize the appearance of the divider in the dropdown showing when using an AutocompleteTextview in android? It's pretty easy for a ListView, but using only an ArrayAdapter for the autocompletetextview, is there any way to customize the divider. (Not the textview, I already know doing that) 回答1: Im not sure how you can do it for single AutoCompleteTextView but I know how to

Is there a way to determine if a <select> dropdown menu is open?

孤人 提交于 2020-01-09 03:43:27
问题 I'm looking for a way to determine if/when a <select> element's menu is open. I don't need to force it to open or close, just figure out if it's open or closed at a given time. I can listen to events for focus/blur, mouseup/mousedown, etc., but I don't think I can reliably figure out the state of the menu from those events. For example, mousedown followed by mouseup could mean the user clicked and dragged to a selection and released (in which case the menu is now closed) or clicked and

Remove an option once it is selected in previous dropdowns

拥有回忆 提交于 2020-01-07 05:35:05
问题 I need to remove the selected option in a dropdown that was selected on the previous dropdwon. For example the first, second and third dropdown contain A, B, C, D. Once I selected A in dropdown1, it won't appear in both dropdowns 2 and 3. Same thing will happen to both dropdowns 2 and 3. But in my code, things are actually like this: I have several dropdowns populated via loop in PHP. for($y=1; $y<=5; $y++){ echo "<select id='seatplan$x' name='selectSeatplan[]' onChange='callSave($x,$sid)'>";