Hi,
I have a javascript function to disable and enable a textbox.
<SCRIPT LANGUAGE="JavaScript">
function enable()
{
document.form1.tmphone2.disabled=false;
document.form1.pmphone2.disabled=false;
}
function disable()
{
document.form1.tmphone2.disabled=true;
document.form1.pmphone2.disabled=true;
}
</SCRIPT>
I need to call the function in a php code, on condition
Heres my code:
<?php
$cc = $row['company_country'];
$s = "SG";
if ($cc == $s)
{
echo "<SCRIPT LANGUAGE='javascript'>disable()</SCRIPT>";
}
else
{
//echo "test ";
echo "<SCRIPT LANGUAGE='javascript'>enable()</SCRIPT>";
}
?>
The above php code doesnt work..
But if i used the same javascript disable() function in an onclick event it works.
Why does the code doesnt work ?
where have i gone wrong.?
:(