bwakad Posted April 5, 2014 Share Posted April 5, 2014 I have gone through the API cheatsheet, and searched on the forum. But I could not find information about displaying values selected with multiselect field. Can anyone give me this? Furthermore, is it possible to limit number of selects for a multi select field? For example minimum 2 maximum 5. Link to comment Share on other sites More sharing options...
adrian Posted April 5, 2014 Share Posted April 5, 2014 You can either foreach through the field: foreach($page->select_field as $selected){ echo $selected->title . '<br />'; } or implode: $page->select_field->implode("<br />", "title"); https://code.google.com/p/jquery-asmselect/issues/detail?id=46 Link to comment Share on other sites More sharing options...
bwakad Posted April 5, 2014 Author Share Posted April 5, 2014 You can either foreach through the field: foreach($page->select_field as $selected){ echo $selected->title . '<br />'; } or implode: $page->select_field->implode("<br />", "title"); https://code.google.com/p/jquery-asmselect/issues/detail?id=46 Thanks for that. Now I made mine with this implode: echo "<li>".$page->field->implode("</li><li>","title")."</li>"; Which will display the chosen values in a list. Link to comment Share on other sites More sharing options...
Martijn Geerts Posted April 5, 2014 Share Posted April 5, 2014 Furthermore, is it possible to limit number of selects for a multi select field? For example minimum 2 maximum 5. In Admin > Setup > Fields > Edit Field: name-of-the-field [input Tab] then use: Custom selector to find selectable pages. under the Selectable Pages Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now