croxton / Stash

Stash allows you to stash text and snippets of code for reuse throughout your templates.
GNU General Public License v3.0
197 stars 20 forks source link

_POST dynamic name in an array #143

Closed colinambler closed 8 years ago

colinambler commented 8 years ago

Hey,

I'm trying to retrieve a value from within an array within the POST. Here's my code:

{exp:stash:get name="member_primary_address[region]" dynamic="yes"}

I'm trying to access the region value, but it won't go! I've tried everything. Any advice?

screen shot 2016-04-28 at 6 47 08 pm
croxton commented 8 years ago

I'm afraid Stash doesn't register POSTed variables that are passed as arrays. You would need individual form fields: <input type="text" name="post_code">

{exp:stash:get name="post_code" dynamic="yes" match="#^[A-Za-z0-9\s]+$#"}

colinambler commented 8 years ago

Bummer! No problem though. I'm on it. Thanks for the response.