Author |
Topic  |
|
SubKamran
Junior Member
 
101 Posts |
Posted - 30 August 2002 : 15:11:49
|
I saw this code and I tried to use it, but it doesn't work...
<script language="javascript">
function OpenPreview()
{
var curCookie = "strMessagePreview=" + escape(document.MassMail.email.value);
document.cookie = curCookie;
popupWin = window.open('../popup/preview.asp', 'preview_page', 'scrollbars=yes,width=650,height=450')
}
//-->
</script>
Then, I just added 'onclick="OpenPreview()"' to my preview button...then it opens THIS page but it doesn't display my message!
<%@ Language=VBScript %>
<html>
<head>
<title>Preview</title>
<link rel="stylesheet" href="../css/default.css" />
</head>
<body>
<!-- #include virtual="includes/functions.asp" -->
<%
'*********************
'** Setup Page Vars **
'*********************
Dim message
strMessagePreview = Request.Cookies("strMessagePreview")
Response.Cookies("strMessagePreview") = ""
'****************
'** Disp Table **
'****************
%>
<table width="100%" cellpadding="3" cellspacing="1" class="OBTable">
<tr>
<td class="CommentTitle" align="center"><span class="BlueLabel">Preview</span></td>
</tr>
<tr>
<td class="alt1">
<%= Trim(Decode(strMessagePreview)) %>
</td>
</tr>
</table>
</body>
</html>
What's up? |
Kamran A Minneapolis, MN Web Developer http://intrepid.newsbyteens.com/ |
|
Nikkol
Forum Moderator
    
USA
6907 Posts |
|
SubKamran
Junior Member
 
101 Posts |
Posted - 31 August 2002 : 16:48:14
|
It just let's me view HTML...
So instead of <b>bold</b> it's bold |
Kamran A Minneapolis, MN Web Developer http://intrepid.newsbyteens.com/ |
 |
|
SubKamran
Junior Member
 
101 Posts |
Posted - 05 September 2002 : 10:38:01
|
HOW DOES SNITZ DO IT?!
just wondering, cuz I have a 'Mass Emailer' and I need to be able to preview my email before I send it!
How does Snitz take care of it? |
Kamran A Minneapolis, MN Web Developer http://intrepid.newsbyteens.com/ |
 |
|
blackinwhite
Average Member
  
Turkey
657 Posts |
Posted - 05 September 2002 : 10:45:39
|
snizt stores the message as a cookie, then pop-up winodws reads the message from the cookie, I think.
I don't like the way snitz does preview. You can alternatively preview your message using request.form. vBulletin does it this way. |
 |
|
SubKamran
Junior Member
 
101 Posts |
Posted - 05 September 2002 : 10:48:26
|
yes, but how can I submit a form if I have two buttons that do it?
Know what i mean? |
Kamran A Minneapolis, MN Web Developer http://intrepid.newsbyteens.com/ |
Edited by - SubKamran on 05 September 2002 10:48:57 |
 |
|
blackinwhite
Average Member
  
Turkey
657 Posts |
Posted - 05 September 2002 : 10:56:40
|
sorry I couldn't get it. if you mean how to preview, that's not hard, and better provides you with "real" preview.
You can add a new input to your form like
<input name="action" value="Preview" /> <input name="action" value="Submit" />
then you use
select case Request.Form("action")
case ........
..
hope that helps. |
Edited by - blackinwhite on 05 September 2002 10:57:13 |
 |
|
SubKamran
Junior Member
 
101 Posts |
|
SubKamran
Junior Member
 
101 Posts |
Posted - 05 September 2002 : 11:02:27
|
Problem, it shows two textboxes with the values...
It needs, type="*"
See, how can I submit a form with two buttons? |
Kamran A Minneapolis, MN Web Developer http://intrepid.newsbyteens.com/ |
 |
|
SubKamran
Junior Member
 
101 Posts |
Posted - 05 September 2002 : 11:03:41
|
I have an idea. Have a checkbox with a value of '1' and name it 'preview'
If the person checked it, preview the message, if not, send it |
Kamran A Minneapolis, MN Web Developer http://intrepid.newsbyteens.com/ |
 |
|
blackinwhite
Average Member
  
Turkey
657 Posts |
Posted - 05 September 2002 : 11:03:43
|
<input type="button" name="action" value="Preview" /> <input type="button" name="action" value="Submit" /> are two buttons.
they also had the values, one Preview, other Submit.
normally, the stuff your submit file has, can be put under
case submit
when you press submit, code under the case submit will be processed. Otherwise, preview will be processed.
in the
case preview
you can do something like.
pTitle = p Message =
etc
Response.Write p Title Response.Write "<div class=""message"">" & pMessage & "</div>"
etc.
|
 |
|
|
Topic  |
|