Disable radio button based on PHP function
<p>I want to call the javascript function based on the result coming from a PHP script.</p>

<pre><code>if ($verify == 'Y' and $approve== 'Y' and $approve_2=='Y') { 
        $state = "disable";
    } else { 
        $state = "undisable"; 
    } 
</code></pre>

<p>Below is my javascript function</p>

<pre><code>function disable() {
                document.getElementById("approvedd1").disabled = true;
                document.getElementById("approvedd2").disabled = true;
}

function undisable() {
                document.getElementById("approvedd1").disabled = false;
                document.getElementById("approvedd2").disabled = false;
}

document.onreadystatechange = &lt;?php echo $state; ?&gt;()
</code></pre>

<p>This does not work. 
I want to call function that can disable radio button, when the page has loaded.</p>