hemi519
05-27-2012, 12:20 PM
Hi All,
Can anyone help me, i ma trying to pass js variable into PHP variable in Javascript.
function tested()
{
var order = document.getElementById('list_filter').value;
alert (order); // i am getting my value here
<?php $name = order; ?>
he_list.callback = "<?php echo $this->callback; ?>";
he_list.list_type = "<?php echo $this->list_type; ?>";
he_list.params = <?php echo Zend_Json_Encoder::encode($this->params); ?>;
he_list.list = '<?php echo $this->list; ?>';
he_list.module = '<?php echo $this->module; ?>';
he_list.ajax_url = '<?php echo $this->url(array('module' => 'hecore', 'controller' => 'index', 'action' => 'list','search' => $name )); ?>'; // in this line it is taking $name as order. can anyone help me, how to get the JS varaible in place of $name
he_list.page = <?php echo $this->items->getCurrentPageNumber() ? $this->items->getCurrentPageNumber() : 1; ?>;
he_list.vlaue = <?php echo $name; ?>
alert(he_list.ajax_url);
alert(he_list.vlaue); //this is giving me JS value
}
Can anyone help me, i ma trying to pass js variable into PHP variable in Javascript.
function tested()
{
var order = document.getElementById('list_filter').value;
alert (order); // i am getting my value here
<?php $name = order; ?>
he_list.callback = "<?php echo $this->callback; ?>";
he_list.list_type = "<?php echo $this->list_type; ?>";
he_list.params = <?php echo Zend_Json_Encoder::encode($this->params); ?>;
he_list.list = '<?php echo $this->list; ?>';
he_list.module = '<?php echo $this->module; ?>';
he_list.ajax_url = '<?php echo $this->url(array('module' => 'hecore', 'controller' => 'index', 'action' => 'list','search' => $name )); ?>'; // in this line it is taking $name as order. can anyone help me, how to get the JS varaible in place of $name
he_list.page = <?php echo $this->items->getCurrentPageNumber() ? $this->items->getCurrentPageNumber() : 1; ?>;
he_list.vlaue = <?php echo $name; ?>
alert(he_list.ajax_url);
alert(he_list.vlaue); //this is giving me JS value
}