Re: Using Javascript to branch from one asp page to another and return

From: fig000 (neilnewton001_at_yahoo.com)
Date: 06/09/04


Date: 9 Jun 2004 07:23:57 -0700

Mark,

   Thanks for answering. I realize that I probably didn't myself clear
enough. The steps I want to follow are:

1. form1 submits to form1processor
2. Somewhere at this point (perhaps in the submit button code of form1
or somewhere in form1processer) the javascript confirm comes up asking
the question:
  "Do you want to do task 2?"
 If they choose "yes" execution goes to form3. Then execution is
passed to form2.
  (By the way Form3 doesn't get the data from form1; it does something
else having nothing to do with form1. I tried doing this
ansynchronously by opening form3 using javascript and having it close
itself but our standard popup blocker prevented this).

 If they choose "no" execution goes to form2.

 So either way we end up at form 2. It seems to me that the issue here
is that unlike other languages, asp is not really good at doing things
asynchronously.

Thanks,
Neil

"Mark Schupp" <mschupp@ielearning.com> wrote in message news:<OK5LIhLTEHA.3944@TK2MSFTNGP12.phx.gbl>...
> Once the first form is submitted you can no longer get any input from the
> user on that page. If you do not want to include your question in the
> client-side validation of the first form then you will have to generate and
> intermediate page to ask your question after updating the database.
>
> form1 submits to form1processor
> form1processor generates html that asks your questions and either
> on "yes" submits data to form3
> on "no" opens form2
>
> form3 goes to form2 as the final result of being submitted
>
> --
> Mark Schupp
> Head of Development
> Integrity eLearning
> www.ielearning.com
>
>
> "fig000" <neilnewton001@yahoo.com> wrote in message
> news:ea2a0f57.0406062004.142b0d77@posting.google.com...
> > Hi,
> >
> > I'm relatively new to Javascript so please bear with me on what
> > might sound like silly questions.
> >
> > This is what I want to do:
> > I'm working in classic asp (I have to for this project). I need
> > to:
> > 1. Click a submit button on an asp page, calling another page
> > that saves the contents of that form to a database and then displays
> > some information from the form. Obviously this part is simple. So
> > let's call these two forms form1 and form2.
> >
> > 2. Here's the part I don't understand. Sometime after the
> > user clicks the submit button, I would like the user to see a
> > confirmation message asking them if they want to do a certain task
> > that. If the user says "yes" I want the code to branch off to a third
> > asp page (form3), do an update to one specific field in the database,
> > and then return to the calling code.
> >
> > I've considered having this occur right when the user clicks the
> > submit button (on form1; this would mean that after the execuation of
> > form3 the program would return to form1.But it occurred to me that it
> > would be better to have the code save the form contents to the
> > database before the confirmation message comes up; this would mean
> > that the program would return to form2 after executing form3. I'm not
> > sure which is best
> >
> > I'm not really used to "branching" using javascript. What needs to
> > happen is the code needs to branch to form3 (depending on if the user
> > clicks "yes" in the confirmation box) and then the program needs to
> > return to the calling asp page to continue the original processing.
> > Also the form fields need to be available to the calling asp page as
> > "request.form" variables(after the return from form3) so that it can
> > continue it's work.
> >
> > The only thing I've seen that runs an asp page and then returns is
> > "sever.execute". This is a vbscript command for ie as far as I know
> > and I'm wondering if there is something similar in javascript. I would
> > suppose it would be like "window.location".
> >
> > Any help would be appreciated. I am open to some other method of
> > doing this than I've outlined here. I feel I've probably missed
> > something.
> >
> > Neil