Quote:
Originally Posted by reddyink
Bobster,
As you suggested, I looked at dynamicdrive code and using and I need your help for the error I am getting. When i call onclick event in echo statement in php page. I am getting follwing error
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in C:\Program Files\EasyPHP 2.0b1\www\upload\tabexternal5.php on line 71
The line where I am getting error is
echo'<input type="button" onclick="javascript:return toggleMe('para1');" value="Toggle">';
echo '<div id="para1">
Decription here....
</div>';
When I change to double quotes like 'para1' to "para1" and also tried with '.para1.'
onclick="javascript:return toggleMe("para1");" value="Toggle">'; - no errors but nothing is happening when I click on toggle button.actually it should expand/collapse.
Javascript:
<script type="text/javascript">
function toggleMe(a){
var e=document.getElementById(a);
if(!e)return true;
if(e.style.display=="none"){
e.style.display="block"
}
else{
e.style.display="none"
}
return true;
}
</script>
Please help me with this echo statement javascript onclick.
Thanks for your reply
|
Hey Ready, can you zip up the entire file and anything else that goes along with it so I can play with it on my dev server? those ' around para1 are causing that error by the way..
anyway, if you can do that.. just PM me and I will give you my email addy so that you can send the file.