Hi Skrol29
I remember what you recently said in a related issue (in response to "onsection question"):
> There is a tip that enables you to use only one block name
> and only one MergeBlock call : add the parameter p1='' in
> the block definitions. Then they will considered as sub-block,
> and query will be recalled for each of them.
OK I tried that, and I think I got a solution but I needed to create another MergeBlock.
Here is the new HTML:
<form action="" method="get" name="form">
<table width="660" border="1" cellspacing="2" cellpadding="0">
<tr>[days-row;block=table]
<td><select name="day[days.#]" size="1" >
<option selected value="0">- select -</option>
<option value="[days.dayID;block=option;p1='']">[days.day]</option>
</select>
</td>
|
and here is the php
$TBS = new clsTinyButStrong;
$TBS->LoadTemplate('time-select.htm');
// for "rows"
$TBS->MergeBlock('days-row', $connection_id, 'SELECT * FROM days') ;
//for populating selects
$TBS->MergeBlock('days', $connection_id, 'SELECT * FROM days') ;
mysql_close($connection_id);
$TBS->Show() ;
|
You were right about p1='' is the key, but I needed to create a duplicate MergeBlock (with different name) to get the desired result. If I used only one MergeBlock, I got the same result as before (i.e. 8 rows but only one day in each select instead of 8).
Any comment or suggestion is welcome.
Thanks alot.
Best regards
Michael.