Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Preview button for a News Manager
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Preview button for a News Manager

 Post Reply Post Reply
Author
moti View Drop Down
Groupie
Groupie


Joined: 07 September 2004
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote moti Quote  Post ReplyReply Direct Link To This Post Topic: Preview button for a News Manager
    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


Edited by moti - 19 April 2005 at 12:29am
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
moti View Drop Down
Groupie
Groupie


Joined: 07 September 2004
Status: Offline
Points: 73
Post Options Post Options   Thanks (0) Thanks(0)   Quote moti Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.