I am trying to pass variables from a form that is located in an iframe back to a page that I can control on my Cold Fusion server. I have a button that will pass the variables back to my page using a hidden form. However, the “trick” is that they don’t want the button to show up until the search page returns 0 results (in the iFrame). And on that page the form is not available.
Is there a way to pass the variables from the previous page in history? If not, is there a way to jump back in history and “auto-submit” the form? Below is my page that shows how I am passing the values currently. In the iFrame there is a form named “form1” with one of the fields named “OAL”. So I only want the button to show up when that field is not available because that means their form values didn’t return results but I need to pass the variables from the previous search page.
[SIZE=1]<script language=”JavaScript” type=”text/javascript”>
function showmevalue()
{
var OAL;
OAL = parent.iframe1.document.form1.OAL.value;
document.newform.OAL.value = OAL;
}
<body>
<FORM METHOD=”LINK” ACTION=”
<INPUT TYPE=”hidden” NAME=”OAL”>
<input type=”button” name=”dotest” value=”show me” onClick=”javascript:showmevalue();”>
</FORM>
<iframe name=”frame1″ ID=”iframe1″ style=”border:none; width:800px; height:900px;” src=”
</body>
I’m not very good at javascript to be honest but any help would be greatly appreciated.
Thanks!!