Forum Moderators: open
<html>
<head>
<script language="Javascript">
function AlterAction(value, id){
document.all.votypeframe.src=value + ".php?epid=" + id;
}
</script>
</head>
<body bgcolor="#addfff">
<form name="vorder" method="post" action="">
<table>
<tr>
<td>
<center><h3>Verbal Order Type:</h3></center>
</td>
</tr>
<tr>
<td>
<center><h4>Request Lab/Lab Results</h4></center>
<script> AlterAction("viewlab", 64); </script>
</td>
</tr>
<tr>
<td>
<IFRAME NAME="votypeframe" SRC="lightblueblank.php" WIDTH="732" HEIGHT="300" align="center" FRAMEBORDER="0" SCROLLING="NO" NORESIZE></IFRAME>
</td>
</tr>
</table>
</form>
</body>
</html>
It gives me an object expected error and does not reload the iframe with the new href...also tried "votypeframe.location.href="etcetcetc"" and that didnt work either. Any ideas?
Thanx,
Adam
..and you shouldn't be using document.all either (IE-only)
Either put that script block below the iframe in the source,
or execute the statement after load (this can go in the head):
[pre]function AlterAction(value, id){
document.getElementById("votypeframe").src=value + ".php?epid=" + id;
// to replace page in history,
// (only if frame is within domain)
// document.frames.votypeframe.location.replace(value+".php?epid"+id);
}
window.onload = function(){ AlterAction("viewlab", 64); }
[/pre]