Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow form pulldown to pre-select multiple values if array is passed containing desired defaults #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

randomecho
Copy link

In cases where the store may want or need to show multiple options in a SELECT form input item, this will allow an array of default values to be passed and pre-selected.

Example:

$comic_publishers[] = array("id" => 'marvel', "text" => 'Marvel');
$comic_publishers[] = array("id" => 'dc', "text" => 'DC');
$comic_publishers[] = array("id" => 'darkhorse', "text" => 'Dark Horse');
$comic_publishers[] = array("id" => 'image', "text" => 'Image Comics');
$comic_publishers[] = array("id" => 'idw', "text" => 'IDW');

$fave_publishers = array('marvel', 'darkhorse', 'image');

echo tep_draw_pull_down_menu('house_of_comics', $comic_publishers, $fave_publishers, 'size="5" multiple');

The above will show a SELECT input field of multiple options, five items showing before scrolling, where "Marvel", "Dark Horse" and "Image Comics" will be already selected.

@randomecho
Copy link
Author

@haradlpdl Do you have any feedback or notes on this?

haraldpdl added a commit that referenced this pull request Aug 7, 2014
Change while loop with foreach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant