- This topic has 0 replies, 1 voice, and was last updated 10 years, 8 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
WordPress Membership Plugin
Simple Membership Plugin › Forums › Simple Membership Plugin › Coding question – need to input an array of arrays on the form
Tagged: code, input, one-to-many arrays
Hi
My question concerns swpm-front-registration, swpm-form, swpm-transfer and the Add and Edit views.
(It is not urgent, although I have been going crazy for some days trying to figure out how to do it.)
My membership form needs to support more than simple one-to-one key=>value pairs of input data. I have all the tables and other code set up, but the problem is the swpm-transfer class wants to initialize each set of fields for a form to:
$some_fields = array
(
‘One_field’ => ”,
‘Another_field’ => ”
);
whereas I need something like
$some_fields = array
(
‘One_field’ => {”,”,”,”, …}
);
The above situation corresponds to a set of checkboxes enabling several chosen activities per member.
In swpm-front-registration, near the end of the regigstration_ui($level) function, after:
if (!empty($swpm_registration_submit))
{
$member = $_POST;
… when I print_r the contents of $member, I can see my selected checkboxes clearly, in the format:
[lang_group] => Array
(
[0] => French Elementary
[1] => Italian Beginners
[2] => Japanese
)
but I can’t get your swpm framework to understand and work with them!
Any ideas? Or else, if this is too complicated, is there a workaround that is not too dangerous? (None of my data is highly confidential – it’s all very mundane stuff.)
Thanks, if and when you have time to answer this.
SP