Tuesday, 15 April 2014

jquery - Unable to hide the non-selected options from a multiple select using Chosen plugin -


I am using the selected plug for multiple selection boxes. I am just trying to show the values ​​already selected, but I am not able to get the required results.

placeholder = "add name" name = "name []" id = "INV" multiple square = "selected-selection" & gt; & Lt ;? Php $ check_names = array (); Forex Currency ($ names_details as the $ line) {$ checked_names [] = $ row- & gt; Names_id; }? & Gt; & Lt ;? Php foreach ($ name as $ line) {? & Gt; & Lt; Option id = "invitees_id []" value = "& lt ;? php echo $ row-> id? & Gt;" & Lt ;? Php echo (in_array ($ line-> id, $ check_name)? 'Selected =' selected '': set_select ('name []', $ line-> ID); ? & Gt; & Gt; & Lt ;? Php echo $ row-> first name. "". $ Line-> last name;; & Gt; & Lt; / Options & gt; & Lt ;? Php}? & Gt; & Lt; / Select & gt;

I have tried to do this in JS:

1)

  $ ('Chosen-selection'). Chosen (); $ ("# Inv"). Chosen ({display_disabled_options: true});  

2)

  $ ("# inv"). Selected ({display_disabled_options: false});  

3)

  $ ("Chosen-selection"). Chosen ({display_disabled_options: false});  

I have not tried any option to help me? suggestion? Thank you. Try adding a "disabled" attribute to "not selected" and "disabled" two different ones.

  & lt; Option id = "invite_id []" value = "& lt ;? php echo $ row-> id? & Gt;" & lt ;? Php echo (! In_array ($ line-> ID, $ check_invites)? 'Disabled = "disabled"': set_select ('name []', $ line-> ID); ? & Gt; & Gt;  

No comments:

Post a Comment