Print Page | Close Window

Preview button for a News Manager

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=14745
Printed Date: 30 March 2026 at 9:38am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Preview button for a News Manager
Posted By: moti
Subject: Preview button for a News Manager
Date Posted: 19 April 2005 at 12:28am
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?
 
 
Thanks



Replies:
Posted By: Mart
Date Posted: 19 April 2005 at 2:41am
function publish()
{

document.postnews.action.value = 'post';

document.postnews.target='postNews.asp';

document.postnews.submit();

}

Try doing that


Posted By: moti
Date Posted: 19 April 2005 at 11:24am
thanks but an 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


Posted By: ub3rl337ch3ch
Date Posted: 25 April 2005 at 8:45pm
make sure the names of the form and field are accurate, both in spelling and capitalisation. I think it is somethng to do with it not picking an element up properly. If all else fails, you could try getElementById('action').value = 'post' instead of document.postnews.value



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net