Re: [SMARTY] Forms forms everywhere.

From: Date: Sat, 11 May 2002 18:14:39 +0000
Subject: Re: [SMARTY] Forms forms everywhere.
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4171@lists.php.net to get a copy of this message
Assign you arrays to the template, then in the template create a section loop to generate the checkboxes. (?) Monte Ray wrote:
asking again and with example functioning php code, How can i get this to work the same way with smarty? <? $sql = "SELECT caption, defaultChk, id FROM newsletters"; $row = $Link->Execute($sql); while (!$row->EOF) { $aRows[count($aRows)]["id"]=$row->fields["id"]; $aRows[count($aRows) - 1]["defaultChk"]=$row->fields["defaultChk"]; $aRows[count($aRows) - 1]["caption"]=$row->fields["caption"];
    $row->MoveNext();
} for ($n = 0; $n < count($aRows); $n++) { $newsletter="newsletter".$aRows[$n]["id"];
    echo "<tr>
<TD valign=\"top\"><INPUT TYPE=\"checkbox\" NAME=\"".$newsletter."\" VALUE=\"1\" ";
    echo ($aRows[$n]["defaultChk"] == 1 || $$newsletter==1) ? " CHECKED" : "";
    echo ">
<font class=bottomFont></font></TD> <TD><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\" style=\"font-size:10px\">".$aRows[$n]["caption"]."</font></TD></tr>";
    }
?> </table>
      </td>
    </tr>
<input type=hidden name=getList value=0> <input type=submit name=signup value=go> </form> Thanks for any help...
-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

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