Categories > TinyButStrong general >

checkbox help me

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: thuc101
Date: 2010-03-14
Time: 04:09

checkbox help me

test.php
------------------------
<?php
    include('tbs_class.php');
    $x='hi world';
    $worker=array('tom'=>1,'Toe'=>0,'Tim'=>1);
    $TBS = new clsTinyButStrong ;
    $TBS->LoadTemplate('test.htm') ;//change here
    $TBS->MergeBlock('blk',$worker) ;
    $TBS->Show() ;
?>
------------------------
test.htm
------------------------
[onshow.x]
<table border="1"><tr><td>[blk.key;block=tr]</td>
<td><input type="checkbox" name="checkbox" value="checkbox" [if[blk.val]=1; then 'checked'; else '']></td>
</tr></table>

------------------------
I like view that
------------------------
<table border="1"><tr><td>tom</td>
<td><input type="checkbox" name="checkbox" value="checkbox" checked></td>
</tr><tr><td>Toe</td>
<td><input type="checkbox" name="checkbox" value="checkbox" ></td>
</tr><tr><td>Tim</td>

<td><input type="checkbox" name="checkbox" value="checkbox" checked></td>
</tr></table>
--------
help me, thank!!!!
By: thuc101
Date: 2010-03-15
Time: 07:26

Re: checkbox help me

I have solved the problem.
Please ignore this thread.
Your code does work.