RE: [SMARTY] counting
| From: | Brian French | Date: | Fri, 12 Jul 2002 18:15:41 +0000 |
| Subject: | RE: [SMARTY] counting | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5274@lists.php.net to get a copy of this message | ||
this is kinda off subject of what your asking, but you can load the
checkboxes into an array by calling the checkboxes name="checkbox[]"
value="{$ids|count}"
-french
-----Original Message-----
From: Blue Presley [mailto:blue928@carolina.rr.com]
Sent: Thursday, July 11, 2002 10:12 PM
To: smarty-general@lists.php.net
Subject: [SMARTY] counting
hello. I am using {section} to loop through mysql results and display them
as rows in a table. I have a check box in the far right column of each
dynamically generated row so that people can select which rows they would
like to delete. in order to properly delete the checked item, I need to
individualize the checkbox names. I currently have it set up like this:
{section name=searchresults loop=$ids}
<tr>
<td><input type="checkbox" name="checkbox{$ids|count}"
value="checkbox"></td>
<td height="30">{$ids[searchresults].postdate}</td>
<td ><a
href="jobdetails.php?ID={$ids[searchresults].adid}">{$ids[searchresults].adt
itle}</a></td>
<td >{$ids[searchresults].location}</td>
<td >{$ids[searchresults].companyname}</td>
</tr>
{/section}
please notice the {ids|count}. I was hoping this would generate a new
number for each loop and, voila, a different name for each checkbox. of
course the numbering should correspond to the number of elements in the $ids
array. I'm not getting the results i want. I guess I'm confused as to how
the count property works
so how do I do it to make it count and give each checkbox it's on name?
(checkbox1, checkbox2, etc)
thanks
blue
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php