rfresh
08-02-2008, 04:24 AM
I am trying to initialize a PHP variable inside my JS section of my form. Although I am runnng Firefox, the var 'php_category_cbo_width' is getting set inside the opera if statement below. This does not make any sense to me - I thought I could set some PHP vars in the JS section and use if statements to control when and if a php var gets set? But my debugging shows me when m form executes, the 'php_category_cbo_width' value is 14 and 16 as intended.
if ($.browser.name == 'firefox')
{
<?php
$_SESSION['php_category_cbo_width'] = 16;
?>
document.getElementById('record_textarea').rows = 20;
}
if ($.browser.name == 'opera')
{
<?php
$_SESSION['php_category_cbo_width'] = 14;
?>
document.getElementById('cat_cbo').size = 9;
}
if ($.browser.name == 'firefox')
{
<?php
$_SESSION['php_category_cbo_width'] = 16;
?>
document.getElementById('record_textarea').rows = 20;
}
if ($.browser.name == 'opera')
{
<?php
$_SESSION['php_category_cbo_width'] = 14;
?>
document.getElementById('cat_cbo').size = 9;
}