Solved

Sending the user to an asp page from fdf JavaScript

Posted on 2003-11-10
10
341 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 200 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
font missing in acrobat 3 81
Browsers won't print to pdf 5 176
PDF writer for SBS 2008 11 113
Adobe Reader DC printing black lines 4 54
Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
Inserting page numbers in Portable Document Files not only enhances manageability but also makes them look professional. With numbered pages, the file appears more organized and it becomes easier to search for a particular page. The size and the vol…
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 convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …

751 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