Hello, my script is rather simple:
function preview_post() {
document.postform.action = 'submain.php';
document.postform.d.value = 'preview';
w = window.open('submain.php?d=preview','previewwin','scrollbars=yes,width=500,height=600');w.focus();
document.postform.target = 'previewwin';
document.postform.submit();
}
The HTML snippets relevent to this:
<form method="post" action="" enctype="multipart/form-data" name="postform">
<input type="button" onClick="preview_post();" value="Preview Message Body" style="width:35%;"></input>
The function works correctly in Firefox 2, the window is popped open, and form executed to that window.
However in IE, the function craps out at:
document.postform.action = 'submain.php';
(I commented out the rest of the function except that to check. It does not cough out an error with the line afterwards, referring to a form field).
The error is:
Object does not support this property or method.
This leads me to believe that IE recognizes the object, but it doesn't want to change the action field of it.
Is the way I did it above not considered the "Standard" way? I tried using document.forms["postform"] however the same error arises.
(The script needs to work in Firefox and IE)
function preview_post() {
document.postform.action = 'submain.php';
document.postform.d.value = 'preview';
w = window.open('submain.php?d=preview','previewwin','scrollbars=yes,width=500,height=600');w.focus();
document.postform.target = 'previewwin';
document.postform.submit();
}
The HTML snippets relevent to this:
<form method="post" action="" enctype="multipart/form-data" name="postform">
<input type="button" onClick="preview_post();" value="Preview Message Body" style="width:35%;"></input>
The function works correctly in Firefox 2, the window is popped open, and form executed to that window.
However in IE, the function craps out at:
document.postform.action = 'submain.php';
(I commented out the rest of the function except that to check. It does not cough out an error with the line afterwards, referring to a form field).
The error is:
Object does not support this property or method.
This leads me to believe that IE recognizes the object, but it doesn't want to change the action field of it.
Is the way I did it above not considered the "Standard" way? I tried using document.forms["postform"] however the same error arises.
(The script needs to work in Firefox and IE)