Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sending the user to an asp page from fdf JavaScript

Posted on 2003-11-10
10
Medium Priority
?
343 Views
Last Modified: 2012-05-04
I have a fdf form that uses insert2gateway.asp as a email and database insert portal I have put some error checking in here to make sure everything works this is called by the JavaScript this.submitForm method,
I want to send the user to another page that check session vars I set in the gateway,
I found I can put a goto URL action in the fdf button after the JavaScript but it gets called even if the JavaScript fails.

Is their any way to do this from inside the JavaScript??
0
Comment
Question by:HamisH
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
10 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 9892036
You have to do this on the server: When the FDF is accepted, the server would then redirect the browser to a new page.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 800 total points
ID: 9982792
Just to clarify: Neither the JavaScript submitForm command, nor the Submit action that you can use as a button action does return a status information. So it's not possbile to open a web link only on success. You can do this however on the server: The CGI script that handles your FDF submission can return a something like the following line in the header of the page:

<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=http://www.yoursite.com/newpage/">
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10341612
Why did you give a "C" grade? Just because this is not the answer you expected does not mean that the answer is wrong. I'll request a review of the grade.
0
Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

 

Author Comment

by:HamisH
ID: 10341737
i gave a c becaue both the ansers you gave did not work a reponse.redirect form with in the asp page causes an error and becaus of the way the page is called a mett refresh wont work eather.

cheers }{amis}{
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10341753
THen you should not have closed the question and requested more information.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10349369
I just verified that a refresh does work: A PDF document in displayed in the browser. I click on the submit button, and the forms information is sent to the web server. The script that processes the data then sends a page with a refresh header. I'm doing this with a Perl CGI script, but I'm pretty sure that anything that I can do with Perl should also be possible with an ASP page.
The information in the browser changes from the PDF document to a very brief display of the redirect page, followed by the target page.

This is the script I'm using (it does not actually process anything, but this discussion, this is not important):

#!/usr/bin/perl -w
use strict;
  use CGI qw/:standard/;

  my $page= '/index.html';
  print header(-refresh => "0; URL=$page");
  print start_html, p('Please wait...'), end_html;

The actual answer to your question was that the JavaScript submitForm() command cannot be used to redirect to a different page. You can also not detect if a submission was sucessful, so it would not work to just access a web site after you call submitForm(). You would go to this new page after a sucessful, and also after an unsucessful forms submission.

In addition to answering your question, I provided a workaround.
0
 

Author Comment

by:HamisH
ID: 10350886
sorry my mestake how di i change the grade?

cheers }{amis}{
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10351018
You can probably just leave a request here, which will be picked up when the moderator reviews this question., but you can also post a request in the SUpport area (use the link at the top of the page).
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publ…
This article explains how to perform batch conversion of PDF, TIFF, and other image file formats into PDF, PDF Searchable, and TIFF files via a command line interface, using Nuance's latest document imaging software — Power PDF Advanced.
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question