FAQ Database Discussion Community


Opening a new php page using JQuery

javascript,php,jquery,mysql,html-select
I would like to open a new page whenever a user clicks one of my html select options using JQuery. Following the example on the JQuery tutorial, I structured my code as shown below. However, the page doesn't open when I click any of the options $('#Databases').change(function () { $.post("test.php");...

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 {...

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...

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...

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:...

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");...

Run function when option is selected angularJS

angularjs,html-select
Currently have my checkboxes adding and subtracting their costs from my total cost. How can I get my select to do the same? Currently its putting in a default value of 7700.00 when without the select field it is at 0.00. Also noticed my select field is breaking my checkbox...

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...

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...

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...

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?...

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"...

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...

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...

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...

Update price based on select options

jquery,html-select
I have multiple select options in a form with prices attached to each with data-price. When any option changes or is selected i need to update the price based on all the selections. I have tried the following: http://jsfiddle.net/325x2d8e/ html: <h3>Size</h3> <select class="form-control calculate" id="size" name="size"> <option data-price="5.00" value="Small">Small</option> <option...

How to generate select option in laravel?

php,laravel,html-select
I am converting my project to pure laravel. Here is my option select tag in html How I can convert it in pure laravel which should also have class name in it <select class="field" name="number"> <option value="0">1</option> <option value="1">2</option> <option value="2">3</option> </select> ...

Angular blank option selected

javascript,angularjs,select,angularjs-ng-repeat,html-select
I'm banging my head against the wall on this one. I have an array of objects that will be used to populate a select drop down: CardCount = [{"ClientId": "0010", "Description": "0010 (206 Members)"}, {"ClientId": "0051", "Description": "0051 (1 Member)"}, ........] When I attempt to use ng-options, the value of...

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...

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"...

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']) }} ...

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...

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 can I select a value from a DropDownList element using jQuery?

jquery,sharepoint-2010,html-select
In my Sharepoint page, I'm dynamically creating dropdownlists like so: ddlDepartureDateMonth = new DropDownList(); ddlDepartureDateMonth.ID = "departurDateMonth"; ddlDepartureDateMonth.CssClass = "finaff-webform-field-input"; ddlDepartureDateMonth.Items.Add(new System.Web.UI.WebControls.ListItem("Jan", "1")); ddlDepartureDateMonth.Items.Add(new System.Web.UI.WebControls.ListItem("Feb", "2")); ddlDepartureDateMonth.Items.Add(new System.Web.UI.WebControls.ListItem("Mar", "3")); ddlDepartureDateMonth.Items.Add(new...

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...

How create Dropdown list only using ViewBag in ASP.NET MVC 4?

asp.net-mvc-4,html-select,html.dropdownlistfor,viewbag
Here I have a model class.. public class MyDrop { public int id { get; set; } public string value { get; set; } } In my controller I use this code.... public ActionResult Index(){ var GenreLst = new List<MyDrop>(); MyDrop a = new MyDrop(); a.id = 1; a.value =...

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...

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...

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...

How set height of select dropdown list in IE 9 [duplicate]

html,css,internet-explorer,internet-explorer-9,html-select
This question already has an answer here: Height of an HTML select box (dropdown) 5 answers I found a bug with select tag in IE 9... In IE 10 and 11, FF, Chrome, Safari everything works fine, but in IE 9 - when list with options become visible, it's...

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...

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> ...

Having trouble getting