Categories > TinyButStrong general >

for loop

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Michaelsen
Date: 2005-07-27
Time: 21:05

for loop


Hello there,

I'm looking a way to achieve the following with tbs, this is the php+html way:

<?php

$ximgs = $_GET["qty"];

for($x=0;$x<$ximgs;$x++) { ?>

  <tr>

    <td style="padding: 5px" bgcolor="#CC0000"><b><font color="#FFFFFF">Product Name:</font></b></td>

    <td colspan="3" style="padding: 5px"><input name="name<? echo $x;?>" type="text" size="30" maxlength="50" /></td>

  </tr>

<? } ?>

I'm unable for the moment to understand how I can build this the tbs way.

I appreciate any help.

Cheers!
By: Skrol29
Date: 2005-07-27
Time: 22:24

Re: for loop

PHP:
$TBS->MergeBlock('bx','num',array('min'->0,'max'->($ximgs-1)));

HTML:
<tr>
   <td ...>Product Name:</td>
   <td ...><input name="name[bx.val;block=tr]" .../></td>
</tr>
By: Michaelsen
Date: 2005-07-28
Time: 06:27

Re: for loop


Thank you for the help!

Your tool is indeed amazing, I'm having trouble to get used to its easiness.

Cheers!!
By: Jared
Date: 2005-08-04
Time: 05:46

Re: for loop

how do you make the block display from max to min instead of min to max ?
By: Skrol29
Date: 2005-08-04
Time: 10:01

Re: for loop

There is an optional 'step' item that you can use.
By: Jared
Date: 2005-08-04
Time: 11:02

Re: for loop

can you give an example please.
By: Skrol29
Date: 2005-08-04
Time: 11:08

Re: for loop

There is one at the Example page.
Example "Data", choose "Numeric"