Enable/Disable a dropdownbox in jquery

Here is one way that I hope is easy to understand: http://jsfiddle.net/tft4t/ $(document).ready(function() { $(“#chkdwn2”).click(function() { if ($(this).is(“:checked”)) { $(“#dropdown”).prop(“disabled”, true); } else { $(“#dropdown”).prop(“disabled”, false); } }); });

Html.EnumDropdownListFor: Showing a default text

Try to change the Index of LicenseTypes start from 1 not 0 like below: public enum LicenseTypes { Trial = 1, Paid = 2 } Then you can use Range attribute to validate the selected license type like below: public class YourViewModel { //Other properties [Range(1,int.MaxValue,ErrorMessage = “Select a correct license”)] public LicenseTypes LicenseTypes { … Read more

How to change font-family of drop down’s list item?

That’s because the select elements children (options) aren’t really stylable and firefox seems to be the only browser to ignore that part of the spec. The workaround is to replace your select element with a custom widget that uses only stylable elements and perhaps a little javascript for the interactivity. like what’s done here: http://jsfiddle.net/sidonaldson/jL7uU/ … Read more

How can I populate a select dropdown list from a JSON feed with AngularJS?

The proper way to do it is using the ng-options directive. The HTML would look like this. <select ng-model=”selectedTestAccount” ng-options=”item.Id as item.Name for item in testAccounts”> <option value=””>Select Account</option> </select> JavaScript: angular.module(‘test’, []).controller(‘DemoCtrl’, function ($scope, $http) { $scope.selectedTestAccount = null; $scope.testAccounts = []; $http({ method: ‘GET’, url: ‘/Admin/GetTestAccounts’, data: { applicationId: 3 } }).success(function (result) … Read more