-2

Possible Duplicate:
How to pass JavaScript variables to PHP?

Here below my code:

function disablefields(){ 

var suresh=[<?php echo $cryo_1kl_18_orig_jan; ?>];

if (document.getElementById('checkboxA').checked == 1){

document.getElementById('cryo_1kl_18_rev_jan').disabled=''; 
document.getElementById('cryo_1kl_18_rev_jan').value='**i want pass the php value here**';

}

I want to pass the php value to javascript...

Community
  • 1
  • 1

2 Answers2

0
function disablefields()
{ 
     var suresh=[<?php //echo $cryo_1kl_18_orig_jan; ?>];

    if (document.getElementById('checkboxA').checked == 1) {
        document.getElementById('cryo_1kl_18_rev_jan').disabled=''; 
        document.getElementById('cryo_1kl_18_rev_jan').value='<?=$your_value?>';
    }
Peon
  • 7,902
  • 7
  • 59
  • 100
0
document.getElementById('cryo_1kl_18_rev_jan').value='<?php echo $php_value;?>';
Vimalnath
  • 6,373
  • 2
  • 26
  • 47