This topic is locked
[SOLVED]

 PHPR is removing my custom javascript

2/24/2011 7:27:07 PM
PHPRunner General questions
G
globiws author

I need to use database values for a custom field. I have figured out how to add a custom field to a page, and how to process the value afterwards, however now I need to assign a value to a javascript variable on pageload for use on the page.
On an ADD page, I have added a custom code snippet to before the header in the visual designer. The custom code snippet is as follows:
global $data;

echo '<script type="text/javascript" src="include/my_ajax.js"></script>';

echo '<script type="text/javascript">

var myact='.$data['fkActivities']+$data['fkActivityOverrides'].';

</script>';
However when I view the resulting ADD page, and look at the source code, it only contains this:
<script type="text/javascript" src="include/my_ajax.js"></script>0;

</script>
Where did the opening javascript tag go? Why is this?
Is there a better way to assign variables to javascript at the beginning of the page for later use?

Sergey Kornilov admin 2/24/2011

I would suggest to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

D
duck 2/25/2011

I have similar issues and would appreciate seeing the answers

G
globiws author 2/25/2011

I have uploaded my project to demo account and logged a support ticket.

I look forward to the resolution on this one.

Thanks,

-Andreas

Sergey Kornilov admin 3/1/2011

Update: there were an issue with PHP error in code snippet. Once error was fixed Javascript code appears in generated file and works as expected.