-2

可能重复:
如何将 JavaScript 变量传递给 PHP?

在我的代码下面:

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**';

}

我想将php值传递给javascript ...

4

2 回答 2

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?>';
    }
于 2012-12-21T08:48:18.053 回答
0
document.getElementById('cryo_1kl_18_rev_jan').value='<?php echo $php_value;?>';
于 2012-12-21T08:48:56.723 回答