problem about multiple-select-Collection of common programming errors


  • Tim
    jquery multiple-select asmselect
    I am using the rather fantastic jQuery multiple select plugin, ASM selectThis plugin is so close to my needs I have to try and fix the one and only bug I can find.On initial load, the selector checks for any elements that have the attribute “selected” and selects them. This is good, except when nothing has the attribute “selected” it chooses the first one.How can I stop it from doing this? I don’t want anything initially selected as 9/10 times it is going to be the wrong option.I am no jQuery coder and have looked through the code and have found several references to building the first select item and have fiddled with them, but have not had any success.I don’t usually do this but seeing as I have absolutely no idea where to start, here is the code for the plugin./** Alternate Select Multiple (asmSelect) 1.0.4a beta – jQuery Plugin* http://www.ryancramer.com/projects/asmselect/* * Copyright (c) 2009 by Ryan Cramer – http://www.ryancramer.com* * Dual licensed under the MIT (MIT-LICENSE.txt)* and GPL (GPL-LICENSE.txt) licenses.**/(function($) {$.fn.asmSelect = function(customOptions) {var options = {listType: ‘ol’, // Ordered list ‘ol’, or unordered list ‘ul’sortable: false, // Should the list be sortable?highlight: false, // Use the highlight feature? animate: false, // Animate the the adding/removing of items in the list?addItemTarget: ‘bottom’, // Where to place new selected items in list: top or bottomhideWhenAdded: false, // Hide the option when added to the list? works only in FFdebugMode: false, // Debug mode keeps original select visible removeLabel: ‘remove’, // Text used in the “remove” linkhighlightAddedLabel: ‘Added: ‘, // Text that precedes highlight of added itemhighlightRemovedLabel: ‘Removed: ‘, // Text that precedes highlight of removed itemcontainerClass: ‘asmContainer’, // Class for container that wraps this widgetselectClass: ‘asmSelect’, // Class for the newly created optionDisabledClass: ‘asmOptionDisabled’, // Class for items that are already selected / disabledlistClass: ‘asmList’, // Class for the list ($ol)listSortableClass: ‘asmListSortable’, // Another class given to the list when it is sortablelistItemClass: ‘asmListItem’, // Class for the
  • list itemslistItemLabelClass: ‘asmListItemLabel’, // Class for the label text that appears in list itemsremoveClass: ‘asmListItemRemove’, // Class given to the “remove” linkhighlightClass: ‘asmHighlight’ // Class given to the highlight };$.extend(options, customOptions); return this.each(function(index) {var $origin

  • scessor
    php arrays select get multiple-select
    My FormName 1 2 3 4 5 :destroy has_many :instructors, :through => :session_instructors accepts_nested_attributes_for :session_instructors accepts_nested_attributes_for :instructorsInstructor model:attr_accessible :bio has_many :sezzions, :through

Originally posted 2013-11-10 00:15:33.