|
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 |
bufffuchs Smarty Rookie
Joined: 19 Apr 2010 Posts: 11
|
Posted: Wed Nov 20, 2013 11:35 am Post subject: Checkoxen |
|
|
hy. also ich habe ein problem. ich übergebe ein userarray an smarty template wo alle relevanten daten drin sind. nu zu den boxen
Code: |
{foreach from=$groupoverview item="g"}
<input type="hidden" name="hidegroup[{$g.g_id}]" {foreach from=$u.gruppen item="gr"}{if $gr.g_id eq $g.g_id} checked value="1" {/if} {/foreach} />
<input type="checkbox" name="gruppe[{$g.g_id}]" {foreach from=$u.gruppen item="gr"}{if $gr.g_id eq $g.g_id} checked value="1" {/if}{/foreach} /> {$g.title}{$g.g_id}<br/>
{/foreach} |
in dem array $groupoverview stehen alle grupen drin die es gibt und in der if abfrage die die der user besitz. funktioniert. nun das problem. wenn ich eine checkbox anklicke wird die leere box nicht mit gesendet. wie bkomme ich das hin dan in php zu sagen das diese checkbox 0 ist dann
mfg |
|
Back to top |
|
Grizzly Smarty Pro
Joined: 15 Apr 2011 Posts: 172 Location: Germany
|
Posted: Thu Nov 21, 2013 8:54 pm Post subject: |
|
|
Wenn es gesetzt wird, wird es an den Server gesendet, ansonsten nicht. Kurz gesagt: mit if(isset($_POST["chkbox"])) überprüft du ob es aktiv gesetzt wurde |
|
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
|