Re: [SMARTY] Array Of check boxes and Forms

From: Date: Sat, 11 May 2002 18:11:25 +0000
Subject: Re: [SMARTY] Array Of check boxes and Forms
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4169@lists.php.net to get a copy of this message
{section name=nl $loop=$aRows} <input type=checkbox name=nl_ids[] value="{$aRows[ln].id}"> {$aRows[ln].id} {/section} After the form is submitted, loop through $nl_ids and see which ones are present (checked). Ray wrote:
Well i got a form where im pulling a list of newsletters to choose from off a Database. The checkboxes are in an array as well. My problem is how to get the submitted checkboxes back into my php code to update what is selected. I ended up using a section to generate the list.. {section name=nl loop=$aRows} <tr><td valign=top><input type=checkbox name=newsletter{$aRows[nl].id} {$aRows[nl].defaultChk}></td><td><a href="javascript:void(0)" onClick="checktheBox(document.signup.newsletter{$aRows[nl].id})" onMouseOver="statusMsg(defaultMsg);return true" onFocus="statusMsg(defaultMsg);return true" onDragStart="window.event.returnValue=false" class=checkboxFont><font class=checkboxFont>{$aRows[nl].caption}</font></a></td></tr> {/section} Now when it gets submitted how can i check to see which item was selected? Liek possibly converting $aRows[nl].id ? Thanx for any help
-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

« previous php.smarty.general (#4169) next »