This works ok in IE, but in Firefox the buttons don't work and I see an error in the javascript console. On the Mozilla forum, I was told I have obsolete javascript. I have select buttons next to a search results table. I replace the iframe on the right when a button is pressed.
HTML (PHP)from mysql_fetch_array while loop for button:
echo("<td><button onClick='return(loadLinkInIframe($id))'>Show</button></td>");
HTML for iframe:
echo ("<iframe name='ifrm' src='recipeframe.php?ID=$id' frameborder='0' width='100%' height='100%' scrolling='auto'>");
echo("</iframe>");
Javascript function:
<SCRIPT language="JavaScript">
function loadLinkInIframe(Id) {
document.getElementById('ifrm').src = "recipeframe.php?ID="+Id;
return (false);}
</SCRIPT>
Error in JavaScript Console in Firefox:
document.GetElementById("ifrm") has no properties.
Thanks in advance for any ideas!
Frank
HTML (PHP)from mysql_fetch_array while loop for button:
echo("<td><button onClick='return(loadLinkInIframe($id))'>Show</button></td>");
HTML for iframe:
echo ("<iframe name='ifrm' src='recipeframe.php?ID=$id' frameborder='0' width='100%' height='100%' scrolling='auto'>");
echo("</iframe>");
Javascript function:
<SCRIPT language="JavaScript">
function loadLinkInIframe(Id) {
document.getElementById('ifrm').src = "recipeframe.php?ID="+Id;
return (false);}
</SCRIPT>
Error in JavaScript Console in Firefox:
document.GetElementById("ifrm") has no properties.
Thanks in advance for any ideas!
Frank