cheers for the advice guys I was being a bit of a tard and am tryign to create an upload box so that you dont have to page refresh or wait for it to upload by using the iframe.submit method
have done it like so
Code:
<script language="javascript">
function upload()
{
// hide old iframe
var par = window.parent.document;
var iframe = par.getElementById('uploadFrame');
iframe.className = 'hidden';
iframe.height='0px';
alert("hidden old iframe");
// create new iframe
var new_iframe = par.createElement('iframe');
new_iframe.src = 'upload.php';
new_iframe.frameBorder = '0';
new_iframe.width= '202px';
par.getElementById('iframe').appendChild(new_iframe);
alert("new iframe created");
//setTimeout(document.iform.submit(),5000);
document.iform.submit();
/*
data_grid.fetchBuffer(0, false, true);
data_grid.requestContentRefresh(0, true);
*/
}
</script>
CSS Looks like this
#iframe {
border-width: 0px;
height: 120px;
width: 203px;
background: url('../images/assetLibrary/gui_nu_library_base.png');
}
.hidden {
visibility: hidden;
width:0px;
height:0px;
}
HTML Looks like this
<div id='iframe'>
<iframe src="upload.php" id="uploadFrame" frameborder='0' width="202px" ></iframe>
</div>
IFrame code looks like this
<form name="iform" action="" method="post" enctype="multipart/form-data">
<div id="imageAddToLibraryBrowseButton">
<input type="file" class="file" name="fileUpload" onChange="upload()"/>
<div id="fakefile">
<img src="images/assetLibrary/BrowseButton.png" alt = "BrowseButton" />
</div>
</div>
</form>
Social Networking Bookmarks