Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Making a preview window?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

muzishun
Senior Member

United States
1079 Posts

Posted - 23 December 2004 :  11:11:06  Show Profile  Visit muzishun's Homepage
I've looked through the code in post.asp and pop_profile.asp but can't seem to find an answer to my question. I'm trying to find out how you get the data from a form into a preview window without posting it all. Here's a basic idea of what I have right now and what I want:
<form action="submit_bio.asp" method="post">
<input type="text" name="stuff">
<input type="text" name="stuff2">
<input type="text" name="stuff3">
<input type="submit" value="Submit Bio">
<input type="preview" value="Preview Bio">
</form>

The red code is what I want. The thing is, I want it to open in a separate page, like this forum does. I'd rather not add a bunch of code to submit_bio.asp if I don't have to. How can I post the data to a second page for previewing?

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 January 2005 :  07:12:14  Show Profile
Have a look at pop_preview.asp and pop_preview_sig.asp to see how Snitz handles it. All you need from post.asp and pop_profile.asp is the preview button.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

DarkDrift
Junior Member

USA
126 Posts

Posted - 05 January 2005 :  10:36:29  Show Profile  Visit DarkDrift's Homepage  Send DarkDrift an AOL message
That is an example then on a seperate page say page.asp you could have the same looks and just use the Request.Form("VALUE") so like
on 1.asp you would have

<form method="post" action="./2.asp">
Phone Number: <input type="text" name="number" size="20">
Signature: <textarea cols="50" rows="50" name="sig"></textarea>
<select name="F_USER_T">
<option value="sub">Submit
<option value="pre">Preview and Submit
</select>
<input type="submit" name="Continue">
</form>


On a Seperate page named for example 2.asp


<%
If Request.Form("F_USER_T") = sub then
'YOUR SUBMIT SQL
else
'Random html formatting
intNum = Request.Form("number")
intSig = Request.Form("Sig")
if intNum = "" or intSig = "" then
%>
you did not complete all required fields
<%
%>
Your Phone Number is: 
<%
Response.Write(intNum)
%>
<br>and your Signature is: <br>
<%
Response.Write(intSIG)
end if
end if
%>


That is just some demo code you may want to tweak it or whatever... Also do look at that pop_profile.asp but this is an alternative.

http://www.xcalliber.com - The Future of Boards

Edited by - DarkDrift on 05 January 2005 10:40:08
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 05 January 2005 :  12:52:40  Show Profile  Visit muzishun's Homepage
So the preview button is another submit button? How does it open the new window? I took a look at pop_profile.asp, and I can't find the preview button. I searched the file for "preview" and "button" with no luck. In what file is this actually stored?

EDIT: I found the preview button, but it references a javascript by the name of OpenSigPreview(), and I can't find that script. I had thought that this shouldn't be too hard, but it's looking like making a preview page is quite a feat. Submitting a form using the request.form and such is pretty straightforward. I take it there isn't any way to post the data without submitting it?

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 05 January 2005 13:01:59
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 January 2005 :  13:02:39  Show Profile
D'oh! Meant to say inc_profile.asp. Search for OpenSigPreview() to find the button; you'll find the OpenSigPreview() function in inc_header.asp (I think!)


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 05 January 2005 :  13:16:36  Show Profile  Visit muzishun's Homepage
The function wasn't in inc_header.asp. That's where I assumed it should be as well. It's crazy, but it is almost as if the OpenSigPreview() function doesn't actually exist (though I know it has to be somewhere). I've checked inc_func_common, inc_func_member, inc_header, inc_profile, inc_func_secure, and inc_func_posting. I managed to find the preview button, but without seeing what that function does, I still don't understand how the data is being posted to the new page.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

Nertz
Junior Member

Canada
341 Posts

Posted - 05 January 2005 :  14:07:08  Show Profile
quote:
Originally posted by muzishun

The function wasn't in inc_header.asp. That's where I assumed it should be as well. It's crazy, but it is almost as if the OpenSigPreview() function doesn't actually exist (though I know it has to be somewhere). I've checked inc_func_common, inc_func_member, inc_header, inc_profile, inc_func_secure, and inc_func_posting. I managed to find the preview button, but without seeing what that function does, I still don't understand how the data is being posted to the new page.



inc_code.js

Sadly, most Family Court Judges wrongfully reward opportunistic gold diggers
that use our children unjustly as "instruments" of power.


www.fathers-4-justice-canada.ca
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 05 January 2005 :  16:06:51  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
See the second post on this page - http://forum.snitz.com/forum/*edited*

How many pieces of data (arguments) will you need to be posting?

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.

Edited by - Podge on 05 January 2005 16:26:52
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 January 2005 :  16:08:49  Show Profile
Podge, that post is in a private forum.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 05 January 2005 :  16:18:44  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Sorry. Its part of the Mod Document Project.

Function OpenPreview()

Arguments: none

Returns:

False if there is no text in the Message textarea
True if there is text in the Message textarea


Found in
inc_code.js

Description
If there is no text in the Message textarea this function will open a modal dialog box with the text “Nothing to Preview!” and return False.

If there is text in the message textarea this function will open pop_preview_sig.asp in a window with scrollbars 750px wide by 450px high named preview_page and then return True. This preview window would normally contain the text of the Message textarea.

Example:
The following example would open a preview window for an onclick event; i.e. a button or hyperlink being clicked.

onclick="OpenPreview()”

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 05 January 2005 :  16:26:10  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Basically, the openPreview function will only open the window.

If you want to pull text, data, etc. from a form you have to do it like its done in pop_preview.asp or pop_preview_sig.asp

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 05 January 2005 :  17:48:22  Show Profile  Visit muzishun's Homepage
Gotcha. Thanks for the help. Hopefully the code in inc_code.js and pop_preview_sig.asp will be enough to get this function working the way I want it to.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.45 seconds. Powered By: Snitz Forums 2000 Version 3.4.07