By: zeflex
Date: 2011-08-23
Time: 15:13
|
MergeBlock de base pseudo récursif
Salut,
J'aimerai savoir comment attribuer chaque valeur des tableaux à chaque checkbox, sans préciser le type de block . A vrai dire je n'ai pas besoin de blocks dans mon cas.
Voici un bout du code essentiel :
En PHP :
$TBS->MergeBlock('name','array',array(
'general_informations','original_title','original_language','duration','amg','studio','image_url','genres','production_year','origin_country','cc','cavco_certified_number','cavco_points','','','','','','','',''
,'','','','','','','','','','','','','','','','','','','',''
,'','','','','','','','','','','','','','','','','','','',''
,'','','','','','','','','','','','','','','','','','','',''
,'','','','','','','','','','','','','','','','','','','',''
,'','','','','','','','','','','','','','','','','','','','','',''
));
$TBS->MergeBlock('checkbox','array',array(
'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N'
,'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N'
,'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N'
));
|
En HTML
<form id="main_form" action="#" method="post" onsubmit="return false;" class="" style="float: left; width: 100%">
<fieldset>
<ul>
<li><input type="checkbox" name="[name.val]" class="main_cb" id="cgi"/>[checkbox.val;att=selected;atttrue='Y'] General informations</li>
<ul class="gi">
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Original title</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Original language</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Duration</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] AMG</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Studio</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Image url</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Genres</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Year of production</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Country of origin</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Canadian certified</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Cavco certified number</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Cavco points</li>
</ul>
<li><input type="checkbox" name="[name.val]" class="main_cb" id="cfo"/>[checkbox.val;att=selected;atttrue='Y'] Formats</li>
<ul>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Format</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Language</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Dub title</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] # Title</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] UPC</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Pricing</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] SRP</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Minimum wholesale price</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Release date</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Closed captionning</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Closed captionning language</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Subtitles</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Subtitles language</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Video description</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Extra features</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Number of discs</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Link Type</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Link URL</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Materials received</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Audio</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Aspect ratio</li>
<li><input type="checkbox" name="[name.val]"/>[checkbox.val;att=selected;atttrue='Y'] Commentary</li>
</ul>
|
J'ai pas mis tout le HTML qui est assez lourd, plus de 120 champs de mémoire.
J'ai donc besoin que name.val n°1 corresponde à la valeur du tableau n°0 et ainsi de suite, pareil pour checkbox.val ...
Je sèches pas mal. Merci .
|