M
|
mdorren author 7/2/2010 |
Hi, I'm trying to use a keyfield in my view header to process a j@v@script if statement: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML {$html_attrs}><HEAD><TITLE>PublicCMS</TITLE> <?php $varcms = $data["cms_id"] ?> <script type=text/javascript> js_cms_id = <?php echo $varcms; ?> document.write(js_cms_id); </SCRIPT> <META name=GENERATOR content="MSHTML 8.00.7600.16588"></HEAD> ...In my test, I can't seem to get the php variable passed to my script variable. I'm sure this must be done quite often, but I can't seem to do a search in the forum on the word J@V@script. Ideas?
|
M
|
mdorren author 7/2/2010 |
In order to simplify my test, I added a simple hello world: <?php $varcms = $data["cms_id"]; $varcms2 = "hello world"; ?> <script type=text/javascript> js_cms_id = <?php echo $varcms; ?>; document.write(js_cms_id); js_cms_id2 = <?php echo $varcms2; ?>; document.write(js_cms_id2); </SCRIPT>
|
M
|
mdorren author 7/2/2010 |
False alarm. It seems I can use {$CMS_ID_value} directly in the script. Thanks for your time anyway
|
A
|
ann 7/5/2010 |
Hi, |