Solved

Sending the user to an asp page from fdf JavaScript

Posted on 2003-11-10
10
337 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
  • 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe In a previous Experts Exchange article, How To Rename-Move a Batch of PDF Files Based on Contents of the Files (http://www.experts-exchan…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now