Categories > TinyButStrong general >

onload?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Bruno
Date: 2005-12-26
Time: 18:18

onload?

Why it's doesn't work if $cat['redirection'] value == 1
It also doesn't work when $cat['redirection'] == any value...:(

<tr>
    <td colspan=2>
         Redirect to: [onload; block=tr; when [cat.redirection]=1]
         <select name=redirection_file>
         <option value=[r_file.fname; block=option]>[r_file.fname]</option>
         </select>
    </td>
</tr>
By: Skrol29
Date: 2005-12-26
Time: 23:56

Re: onload?

Hello Bruno,

This is a classic mistake. You should use [onshow] instead of [onload] because [onload] blocks are evaluated as soon as the template is loaded. This means before [cat.redirection] is merged.
By: Bruno
Date: 2005-12-27
Time: 00:52

Re: onload?

THANK YOU!!
By: Bruno
Date: 2005-12-27
Time: 06:00

Re: onload?

It's me again :)
Why it's doesn't work: [onshow; block=tr; when [bar.#] != 1]
By: Skrol29
Date: 2005-12-29
Time: 14:25

Re: onload?

First check if [bar.#] is correctly merged when [onshow] is supposed to be processed. To do this you can, for example, rename you tag like this :
  [onshowx; block=tr; when [bar.#] != 1]
And then look what it becomes...

By: Skrol29
Date: 2005-12-29
Time: 14:35

Re: onload?

Also check your Html source if your editor didn't insert a line break inside the TBS tag.
I've tested your snippet, it works fine for me.