Hi,
I have been trying to populate some javascript with values from php variables but cannot get the syntax correct.
I have read the php manuals and searched on this forum but cannot find any examples to learn off.
Bascially I am passing two php variables to a php page which tries to create the javascript with the php variables as follows
<input type="hidden" value="" name="field1">
<?php
$editor = "editor";
$form_field = "field1";
echo "\n document.".$editor.$form_field.".value = 1;"
what I want to do is dynamically build the javascript so that I can update a hidden form field on the same page.
I want the output when php has finished to be
document.editor.field1.value =1;
php complains about the line. I think its because I do not fully understand how to join static text (in quotes) with php variables.
any help much appreciated.