Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Checkoxen

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
bufffuchs
Smarty Rookie


Joined: 19 Apr 2010
Posts: 11

PostPosted: Wed Nov 20, 2013 11:35 am    Post subject: Checkoxen Reply with quote

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} />&nbsp;{$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
View user's profile Send private message
Grizzly
Smarty Pro


Joined: 15 Apr 2011
Posts: 172
Location: Germany

PostPosted: Thu Nov 21, 2013 8:54 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP