<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Memorizzare Checkbox nell'array checked]]></title><description><![CDATA[<p dir="auto">Salve,<br />
Ho una serie di chack box salvate nell'array</p>
<pre><code>&lt;input type="checkbox" align="top" name="sport[]" value="calcio"/&gt; Catania &lt;br /&gt;
&lt;input type="checkbox" align="top" name="sport[]" value="pallavolo"/&gt; Chievo &lt;br /&gt;
 &lt;input type="checkbox" align="top" name="sport[]" value="Rugby"/&gt; Fiorentina &lt;br /&gt;
</code></pre>
<p dir="auto">come vedete non sono spuntate.<br />
All'invio del form, le recupero cosi :</p>
<pre><code class="language-php">//RECUPERO LE CHECKBOX E LE METTO IN ARRAY
 $checkboxArray = array();
 $checkboxArray = $_POST["calcio"];
 foreach(@$checkboxArray as $check_box_value)
  {
           $trovato= "Hai selezionato: $check_box_value &lt;br&gt; ";      
   }
</code></pre>
<p dir="auto">Se in qualche parte del form, c'è un errore, non riesco a metterla checked in modo da ricordare il valore gia inserito.... (Immaginate di spuntare<br />
30 checkbox e poi rifarlo ad ogni errore...)<br />
Mi potete aiutare ?</p>
]]></description><link>https://dev.connect.gt/topic/193991/memorizzare-checkbox-nell-array-checked</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 02:49:24 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/193991.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Sep 2013 11:29:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Memorizzare Checkbox nell'array checked on Wed, 02 Oct 2013 14:53:03 GMT]]></title><description><![CDATA[<p dir="auto">Ok gia fatto grazie lo stesso.</p>
]]></description><link>https://dev.connect.gt/post/1138113</link><guid isPermaLink="true">https://dev.connect.gt/post/1138113</guid><dc:creator><![CDATA[infosicurezza]]></dc:creator><pubDate>Wed, 02 Oct 2013 14:53:03 GMT</pubDate></item><item><title><![CDATA[Reply to Memorizzare Checkbox nell'array checked on Wed, 02 Oct 2013 13:19:02 GMT]]></title><description><![CDATA[<p dir="auto">Quando stampi gli input, devi controllare se nel tuo array $checkboxArray esiste quel valore, se esiste, allora aggiungi checked="checked"</p>
]]></description><link>https://dev.connect.gt/post/1138114</link><guid isPermaLink="true">https://dev.connect.gt/post/1138114</guid><dc:creator><![CDATA[codencode]]></dc:creator><pubDate>Wed, 02 Oct 2013 13:19:02 GMT</pubDate></item></channel></rss>