vendredi 16 janvier 2015

Change value of checked on checkbox html in tcpdf

I am building an application using codeigniter and then to generate the report I am using TCPDF. My question is, how to send checked value from my form into tcpdf ? So it will be dynamically.


My HTML code



<div class="controls">
<label class="checkbox inline">
<input type="checkbox" name="request[]" id="Login" value="Login" > Login
</label>

<label class="checkbox inline">
<input type="checkbox" name="request[]" id="Printer" value="Printer"> Printer
</label>

<label class="checkbox inline">
<input type="checkbox" name="request[]" id="Monitor" value="Monitor"> Monitor
</label>

<label class="checkbox inline">
<input type="checkbox" name="request[]" id="Computer" value="Computer"> Computer
</label>

<label class="checkbox inline">
<input type="checkbox" name="request[]" id="Network" value="Network"> Network
</label>

<label class="checkbox inline">
<input type="checkbox" name="request[]" id="Others" value="Lain-lain" > Others
</label>


TCPDF code



$html = <<<EOD

<form action="">
<input type="checkbox" name="request[]" id="Login" value="Login" > Login
<input type="checkbox" name="request[]" id="Login" value="Login" > &nbsp; Printer
<input type="checkbox" name="request[]" id="Login" value="Login" checked="checked"> &nbsp; Monitor
<input type="checkbox" name="request[]" id="Login" value="Login" > &nbsp; Computer
<input type="checkbox" name="request[]" id="Login" value="Login" > &nbsp; Network
<input type="checkbox" name="request[]" id="Login" value="Login" > Lain-lain
</form>
EOD;

$pdf->writeHTMLCell(0, 10, '', '', $html, $border = 0, $ln = 1, $fill = false, $reseth = true, $align = 'L', $autopadding = false);


What should I do ? Using js or what ? Thanks for the help,





Aucun commentaire:

Enregistrer un commentaire