|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
wrenholte Smarty n00b
Joined: 18 Apr 2003 Posts: 2 Location: Kansas City, MO
|
Posted: Wed Apr 23, 2003 9:49 pm Post subject: Forms (Check boxes in a section loop) |
|
|
I have a form, that displays all of the contents of a search. I want the user to be able to go through and check mulitple items to delete, but currently I can only get one variable(the last item checked) through to the php page.
Code: |
<table>
{section name=events loop=$row}
<tr><td>
<input type=checkbox name="delete" value="{$contactid[events]}">
{$contactid[events]}</td></tr>
{/section}
</table>
|
Has anybody done this before, or have any suggestions? All of my code is working fine, except that I can only delete one item at a time. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Apr 23, 2003 10:10 pm Post subject: |
|
|
you have to supply an array via your form:
Code: |
...
<input type=checkbox name="delete[{$contactid[events]}]">
...
|
then "array_keys($_REQUEST['delete'])" will give you a list of the values subjected for termination |
|
Back to top |
|
wrenholte Smarty n00b
Joined: 18 Apr 2003 Posts: 2 Location: Kansas City, MO
|
Posted: Thu Apr 24, 2003 1:57 pm Post subject: |
|
|
Yipee! It worked. --- Thanks! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|