Categories > TinyButStrong general >

onload problems

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: olifants
Date: 2008-07-30
Time: 17:39

onload problems

Hi,

I try to insert a html file with onload depending on a given value, but get errors:

php
...defined constants...
$tmpl = new clsTinyButStrong;
$tmpl->LoadTemplate($callPageHtml);
$insert = 1;
$tmpl->Show(TBS_OUTPUT)

html
[onload;file=[var.insert;if [val]=1;then '[var..cst.FOUND]';else '[var..cst.SEARCH]']]

TinyButStrong Error in field [var.insert...] : the PHP global variable named 'insert' does not exist or is not set yet. This message can be cancelled using parameter 'noerr'.

TinyButStrong Error in field [onload...] : the file '[var.insert;if =1;then '[var..cst.FOUND]';else '[var..cst.SEARCH]']' given by parameter file is not found or not readable. This message can be cancelled using parameter 'noerr'.

Thanks

Olifants
By: TomH
Date: 2008-07-30
Time: 18:11

Re: onload problems

You are getting the field 'insert' does not exist or not set because in your PHP you have already 'load'-ed the template.

The onload process takes place at that instant - whick is before you define the var.insert

Just try
$insert = 1;
$tmpl->LoadTemplate($callPageHtml);

Hope that helps,
By: olifants
Date: 2008-07-30
Time: 18:30

Re: onload problems

yes, the variable was set. thanks