Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 1835

Extension Writers Discussion • Get value from HTML multi select

$
0
0
I have a multi-select element and I'm trying to capture the values in it but it's not working and I've got no idea why the value isn't getting passed through to the $request variable. I'm sure I'm missing something very simple.

The HTML from my template:

Code:

<select name="group_membership[]" id="group_membership" multiple="multiple" size="10">{% for group in GROUPS %}<option value="{{ group.id }}">{{ group.name }}</option>{% endfor %}</select>
This is how I'm trying to capture the values in my controller.

Code:

$memberships = $request->variable( 'group_membership', '' );var_dump( $memberships ); die();
This is what the var_dump() is outputting.

Code:

/Users/danieltj/Local Sites/phpbb/app/public/ext/danieltj/extension/controller/acp.php:161:string '' (length=0)
Any ideas what I'm doing wrong?

Statistics: Posted by danieltj — Wed Jul 24, 2024 8:50 am



Viewing all articles
Browse latest Browse all 1835

Trending Articles