Jump to content

question - display values of multiselect


bwakad
 Share

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...