M
mike
I have a page with a form as follows:
<form name="updfrm" method="post" action="update_db.cfm">
<input type="text" name="myfield" value="stuff">
<button onclick="sub_this();">press here</button>
</form>
normally I would either 1) let this form post to this window, or 2)
open a window and post to it.
I'd like to try posting that using an iframe.
So, I create that iframe in the same page as the form like:
<div style="display:none">
<iframe src="" id="update_iframe" name="update_iframe">
</iframe>
</div>
The script that takes the content from the form and updates the
database is called update_db.cfm.
So, my function looks like:
function sub_this()
{
var mycgi = "update_db.cfm";
document.getElementById('update_iframe').src=mycgi;
document.updfrm.target = document.frames['update_iframe'];
document.updfrm.submit();
}
My browser IE6 does not like this at all. Its dieing and barfing.
Anyone see any problems here.
I have gotten this to work using get, but not post. Using get my
sub_this function would look like:
function sub_this()
{
var mycgi = "update_db.cfm?thecontent=" +
document.updfrm.elements['myfield'].value;
document.getElementById('update_iframe').src=mycgi;
}
I don't really want to use get because I'd have to encode every
variable in the url. Some of them may be long.
Mike
<form name="updfrm" method="post" action="update_db.cfm">
<input type="text" name="myfield" value="stuff">
<button onclick="sub_this();">press here</button>
</form>
normally I would either 1) let this form post to this window, or 2)
open a window and post to it.
I'd like to try posting that using an iframe.
So, I create that iframe in the same page as the form like:
<div style="display:none">
<iframe src="" id="update_iframe" name="update_iframe">
</iframe>
</div>
The script that takes the content from the form and updates the
database is called update_db.cfm.
So, my function looks like:
function sub_this()
{
var mycgi = "update_db.cfm";
document.getElementById('update_iframe').src=mycgi;
document.updfrm.target = document.frames['update_iframe'];
document.updfrm.submit();
}
My browser IE6 does not like this at all. Its dieing and barfing.
Anyone see any problems here.
I have gotten this to work using get, but not post. Using get my
sub_this function would look like:
function sub_this()
{
var mycgi = "update_db.cfm?thecontent=" +
document.updfrm.elements['myfield'].value;
document.getElementById('update_iframe').src=mycgi;
}
I don't really want to use get because I'd have to encode every
variable in the url. Some of them may be long.
Mike