hello everyone,
I am new with iframes. Currently I am creating an iframe
within an existing form. The main form has couple of checboxes, and
also the iframe has couple of checkboxes. I want to pass the values
of iframe checkboxes to another page when a submit button is
clicked. The submit button is present in the main page. Is there a
way to do this. I was trying to use a hidden text box in the main
page which will get populated with the iframe checkbox value, but
this does not seem to be working.
Can anyone suggest anyother way of doing? my current code is
as follows
<html>
<script language="javascript" type="text/javascript">
function checKer(inputID) // where inputID = checkbox
{
var x = document.ScannedSearch.elements[inputID];
var ifOb =window.frames("iframecat");
var y =
ifOb.document.forms["SelectCategories"].elements[inputID];
if(y.checked == true)
{
alert('Is checked and has a value of y = ' + y.value);
}
else
{
alert('Is not checked');
}
}
</script>
<body onLoad="">
<form name="ScannedSearch" method="post"
action="filler1.cfm">
<input type="text" name="iframecategories" value="">
IFrame3: <input type="checkbox" id="testcheck"
value="IFrame3" onClick="checKer('testcheck')";/>
IFrame4: <input type="checkbox" name="try2"
value="IFrame4" />
<iframe id="iframecat" src="filler.cfm">
</iframe>
<input type="submit" name="submit" value="Go"/>
<br>
<br>
<br>
</form>
</body>
</html>
filler.cfm
<html>
<form action="filler1.cfm" name="SelectCategories"
method="post">
IFrame1: <input type="checkbox" name="IFrame1"
id="IFrame1" onclick="checKer('IFrame1');"/>
IFrame2: <input type="checkbox" name="IFrame2"
id="IFrame2" onclick="checKer('IFrame2');"/>
</form>
</html>
Thanks