User-108969407 posted
Hi all [;)]
I created a News manager with ASP
in Post News Page I have 2 button first one "Publish" and second is "Preview News" like this forum,
the problem,
I have a page with this name "dostuff.asp" this page is for posting news ,
I am using this javascript code for previewing News in a popup window
the page for previewing news is a section of dostuff.asp
<script language="JavaScript">
function preview()
{
window.open('dostuff.asp','previewWin','scrollbars=yes,resizable=yes,width=650,height=500');
document.postnews.action.value = 'preview';
document.postnews.target='previewWin';
document.postnews.submit();
}
</script>
when I click on Preview button every thing is ok and it will show me the preview of News ,
But when I close the preview window and click on publish button it will open preview window again,
Its something like a history for javascript after clicking on preview button it will store file address in somewhere and after I click on the publish it will open stored address of file
what is the solution for this problem?
I uesd this code but I get an error
-----------------------------
function publish()
{
document.postnews.action.value = 'post';
document.postnews.target='postNews.asp';
document.postnews.submit();
}
------------------------------
this error:
Object doesn't support this property or method
==
the line 150 line 150 is this
<input type="button" value="Preview" name="B3" onclick="publish()">
where I call the function
------------------------------------------------------------------------
Thanks