FAQ Database Discussion Community


Html\CSS - unable to align custom Select tag along with a custom Checkbox

html,css,checkbox,html-select
I've created several custom checkboxes, where the first element is also a select element. I need all the elements to be in the same line, but in order to reduce the margin between each line I used line-height=something property, but this causes the text of the select element to be...

Formatting dates in an MVC Dropdown

date,model-view-controller,html-select
I have a dropdown list on my page as so: - @Html.DropDownList("dd_dates", new SelectList(@Model.seasonDates), "Please Select") where seasonDates is an IList of dates. The problem is that when the dates are displayed in the dropdown they also have the time on them as well. How do I format the display...

How can I find get attribute of a select tag where value = something using jquery?

jquery,select,drop-down-menu,html-select
How can I get the price attribute's value where #products.option value = 6. <select id="products"> <option value="2" price="60.00">Product 1</option> <option value="4" price="40.00">Product 2</option> <option value="6" price="40.00">Product 2</option> <option value="8" price="40.00">Product 2</option> </select> ...

filtering not working from select

jquery,table,datatable,filtering,html-select
I have created a application with dataTable with fixed headers and sorting, the application is working fine but the issue is that I am having a name filtering through a drop-down, which is not working when I select a particular name. My code is given below. Can anyone please tell...

What is the proper way to get the value of a React element in Django

javascript,html,django,html-select
I have a drop down menu that is created in the following fashion: <select id="ip_addr"> {% for host in hosts %} <option value="{{ host.ipaddress }}">{{ host.ipaddress }}</option> {% endfor %} </select> and I don't know how to set the default value. Normally I would just say something like <option value="0.0.0.0"...

HTML select with angularjs ng-options to MVC Model, can't do it

html,asp.net-mvc,angularjs,html-select
I'm trying to insert my selected value to MVC model. I saw some answers with @Html.DropDownList but i can't figure it out. this is my select code : Manufacturer : <select ng-model="UserCarManufacturer" ng-options="I.id as I.name for I in CountryList" ng-change="GetState()" class="form-control" id="CarManId"> <option value="">Select Manufacturer</option> </select> {{UserCarManufacturer}} {{UserCarManufacturer}} is the...

How to properly resize select form input

html,forms,html-select
I have a form which uses both text fields as well as select options. I styled the form using the following CSS: input[type=text] { width: 250px; height: 30px; text-indent: 10px; border-width: 3px; border-color: rgba(50, 50, 50, 0.14); margin: 10px 10px 10px 0px; padding: 5px 5px 5px 5px; } select {...

Javascript if an option is selected than a new sets of option appear

javascript,jquery,html,forms,html-select
In a nutshell, I would like that when the user selects an option, a set of options appear in relationship that option selected. Below is what I have done thus far: The HTML: <form method="" action=""> <input type="file" placeholder="Upload Project"> <select id="selectProvider"> <option disabled selected> Select Training Platform </option> <option...

Adjust width of select element according to selected option's width

javascript,jquery,twitter-bootstrap,twitter-bootstrap-3,html-select
I want the select element to have the default option value's width which is shorter. When the user selects another option, the select element should resize itself so the whole text is always visible in the element. I have found a solution in the question Auto resizing the SELECT element...

HTML Select Form Variable Default Value

html,html-select,javascript-databinding
I am trying to set a default value for a HTML select form. I've read the posts on setting a constant default value for a select form. However, I want the default value to be the variable shirt.Color, which is either Small, Medium, or Large depending on the shirt. For...

How to get a deleted element in a contenteditable div?

javascript,html,html5,javascript-events,html-select
I set the root div to contenteditable, and it contains many img and video elements. So when a user edits it and presses backspace to delete one element, How can I get which one the user deleted and get the deleted element's attributes values?

Dropdown first option value not functional

php,jquery,location,html-select
I have a problem whit my dropdown list, I need to change location page when option selected using value option attribute, but the first option element not functional, This is the html code: <form> <select class='language-select' name='URL' id='URL'> <option value="index.php?lan=EN" selected> English</option> <option value="index.php?lan=FR">Français</option> </select> </form> and this is the...

Removing “selected” atttribute from cloned select options not working in IE

jquery,attributes,html-select,selected
I have written a plugin that converts a <select multiple> into multiple, mutually exclusive, single <select>s. The initial HTML rendered has multiple <option selected> which were set server-side: <select id="template" style="display: none;" multiple=""> <option value="1">One</option> <option value="2" selected="">Two</option> <option value="3">Three</option> <option value="4" selected="">Four</option> <option value="5">Five</option> <option value="6"...

Angularjs xeditable selected option not shown

angularjs,html-select,x-editable
I have editable rows in a table and I can't seem to show the selected value in my dropdown list. Everything else in the process works fine. Code at: http://jsfiddle.net/bzLj3a5q/7/ Html: ... <span editable-select="ad.ad_type_id" e-name="ad_type_id" e-form="rowform" e-ng-options="id as type for (id,type) in ad_types" onshow="showType(ad)"> {{ ad_types[ad.ad_type_id] }} </span> ... Controller:...

Insert hidden text inside selectbox option

php,html-select,hidden
I have a selectbox that displays name and surname for a list of people. But I want to add an id for each of them and make it invisible. EX. if we have John Smith with ID 001 I want to write John Smith:001 , but it should be seen...

Can't change select option item angular

javascript,json,angularjs,html-select,angular-ngmodel
I have a select option like this: <select ng-init="filterSelected = getItems.data.key" ng-model="filterSelected" ng-options="data.key as data.label for data in getItems.data" ></select> In which i parse a json that returns me some results that shows as item in this select. This is not a problem, i can display the items but i...

Javascript jQuery - selecting select box option only works sometimes

javascript,php,jquery,html-select
the project is an MVC project writen in PHP I have an AJAX call in a veiw that echoes, into a div, a bit of Javascript that does some things on the page. At the end of the script is a piece of JQuery that should change a select boxes...

How do I bind an HTML select to a model value in Rivets.JS?

javascript,jquery,html-select,jquery-chosen,rivets.js
I'm trying to integrate Rivets.JS into my app. I'm getting the hang of binding values for basic form inputs and regular data in the page, but I can't figure out how to handle selects drop (down menus) with Rivets. I can build a select with the each tag, like in...

space is shown when selecting the dropsdown option - angularjs

javascript,angularjs,html-select,space,dropdownbox
I have created an application in AngularJS with a drop down with space in option using a filter. The application is working fine with the options in drop down with indentation space before the values but the problem is when a select an option which is having a space, the...

How can I determine the value of the selected dropdown option using getElementsByClassName?

javascript,select,html-select,getelementsbyclassname
How can I determine the value of the selected dropdown options using javascript. I can't use id selector so I was trying with document.getElementsByClassName. I understand that returns a set of values. Here is a simplified code I am trying to use: <div id="MDL" class="dates"> <p>Select Dates and Price</p> <select...

Rails select_tag will not access belongs_to relation

ruby-on-rails,ruby,model,html-select,belongs-to
I am trying to do a select_tag "employee_compensation_benefits_selection", options_from_collection_for_select(@employees, "id", "entity.name", "1") but entity.name wont work throws an undefined method `entity.name'. "entity" belongs to another model. through an entity_id class Employee < ActiveRecord::Base include UUIDHelper belongs_to :entity has_one :status has_many :restdays has_one :regular_work_period validates_presence_of :entity end require 'file_size_validator' class Entity...

select option with javascript is not displaying select value

javascript,html-select
here i have a simple 3 select options , like select 1 ,select 2 and select 3 . on changing select 1 option will reset the values in select 2 and select 3 , and on changing the select 2 values calling another javascript function to reset the values in...

Kendo dropdown with ng-options instead of DataSource

javascript,angularjs,kendo-ui,html-select,angular-directive
I've got a dropdown list defined using angular like this: <select class="form-control" ng-model="controller.selectedUser.superiorId" ng-options="superior.userId as superior.lastName + ' ' + superior.firstName for superior in controller.superiors | orderBy:['lastName', 'firstName']"></select> This works fine, however I want to show a little image next to the entries and so I'm trying to convert this...

Laravel 5 array validation

arrays,validation,laravel-5,html-select
In laravel 5 how do i validate an array to check if at least one value is selected - the following doesn't work? 'user_list[]' => 'array|min:1', {{ Form::select('user_list[]', $users, null , ['multiple' => 'multiple']) }} ...

select values in a form not getting submitted

ruby-on-rails,forms,html-select,form-submit
I'm not exactly sure what I'm missing, when I use the dev tools the form shows up properly in the html but the only value that is not being submitted it the one in the drop down. I looked at my database and it's not submitting any value at all...

WTForms usage for dynamic options?

javascript,google-app-engine,html-select,wtforms
I use WTForms with Jinja2 in appengine and I have a dynamic option field where the available choices for a city depends on the choice of a region. Now I want to enable validation also for regions and cities (mainly if a user didn't select a region/city) but I don't...

Showing and hiding sections with CSS based on a drop-down option

html,css,hide,html-select
Iam using a rather neat example where a user hid sections based on the input from radio buttons, listed below: CSS: div[class^="section"] { display: none; } input.choose-a:checked ~ div.section-a, input.choose-b:checked ~ div.section-b, input.choose-c:checked ~ div.section-c { display: block; } HTML: <input type="radio" class="choose-a" name="sectionselect"/> <input type="radio" class="choose-b" name="sectionselect"/> <input type="radio"...

angular js : issue with html5 select

javascript,angularjs,html5,html-select
I came across this strange behavior today.. The same I found with one fiddle..(saved some time to explain the issue..) I have a fiddle here: http://jsfiddle.net/w9mQ8/2/ It demonstrates how to set a selected value in html select. Now, the strange thing in it.. The fiddle the result pane shows the...

Autocomplete-like interface with separate ID field?

jquery,autocomplete,html-select
I'd like to use jQuery Autocomplete to offer a sort of interactive dropdown in my form. However, I'd like to display 2 fields - the ID and the description. While it is easy to output both, I can't find a way to keep the ID and the text you want...

Bootstrap3 + Angular with Select causes the drop down to cut off

angularjs,html5,twitter-bootstrap-3,html-select,ng-options
I am trying to use the HTML Select tag along with AngularJs using the ng-options directive to create a drop down options menu. On top of this I am using Bootstrap 3. I also have ui-bootstrap imported into the project. Everything works functionally but I have an odd issue where...

How to get all dropdown values in string array in java?

java,html,arrays,servlets,html-select
I know this is a very basic question but I am not able to track the error This is my dropdown lists <select name="prodnd" id="prodnd" style="display:none"> <option value="Andorra">Andorra</option> <option value="Antarctica">Antarctica</option> <option value="Bulgaria">Bulgaria</option> </select> I want all these option values in servlet I tried getParameterValues in servlet String[] prodn = request.getParameterValues("prodnd");...

jQuery - hide option element by value

jquery,select,hide,html-select
Trying to hide an option element from a list. I have tried several methods however, cannot seems to work. I need to call select by name as I cannot add ID or class. $('select[name*="boxes"] option[value="box6"]').hide(); here the fiddle: http://jsfiddle.net/q2nb08t6/ any suggestions?...

Having trouble getting