473,722 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.fo rm" 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.locatio n".

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
Jul 19 '05 #1
3 2303
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" <ne***********@ yahoo.com> wrote in message
news:ea******** *************** ***@posting.goo gle.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.fo rm" 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.locatio n".

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

Jul 19 '05 #2
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" <ms*****@ielear ning.com> wrote in message news:<OK******* *******@TK2MSFT NGP12.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" <ne***********@ yahoo.com> wrote in message
news:ea******** *************** ***@posting.goo gle.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.fo rm" 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.locatio n".

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

Jul 19 '05 #3
It is not vbscript or ASP that is your problem. It is the nature of HTTP
that you have to work around.

HTTP is a connectionless protocol that consists of requests and responses.
The browser sends a request and the server returns a response. By the time a
page displays in the browser, all processing is complete on the server. Any
further operation on the server requires a request from the browser. If you
do not want to include the question about the optional processing in the
validation of the original form then the form processing script must return
an HTML page to ask the question. Then another request must be made to the
server to perform the "form3" processing.

If you want to have form2 ask the question and trigger form3 on the server
then you will have to send another request. You could have javascript send
the request and target a hidden frame window if you can use frames or you
can have form3 "bounce" back to form2 in the main window. You could also do
something with a component loaded on the page to send the request
transparently (MSXML2.XMLHTTP for IE, a Java Applet for others).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"fig000" <ne***********@ yahoo.com> wrote in message
news:ea******** *************** ***@posting.goo gle.com...
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" <ms*****@ielear ning.com> wrote in message

news:<OK******* *******@TK2MSFT NGP12.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" <ne***********@ yahoo.com> wrote in message
news:ea******** *************** ***@posting.goo gle.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.fo rm" 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.locatio n".

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

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2338
by: fig000 | last post by:
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
13
9646
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be assigned to a variable and output using document.write. (Note, there is no submit button or other form elements. Basically
7
3355
by: adam | last post by:
i'm working on a portion of a CMS that allows content-admins to browse a product list, and add individual products into the taxonomy by clicking checkboxes next to categories they might belong in. since the taxonomy is a rather long list, i'm hiding and showing divs for the secondary and tertiary links, so when a user clicks on the checkbox for the parent category, the children appear in a second (and third) div, with checkboxes of their...
8
33691
by: Dave | last post by:
Hello all, I have been able to use a Javascript alert box in my vb.net web application, for example: Dim msg As String = "Hello, world." Dim alertScript As String = "<script language=JavaScript runat=server>" alertScript &= "alert('" & msg & "');" alertScript &= "</script>"
2
3055
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is what I'm hoping to achieve. I've never before had to use Javascript closures, but now I do, so I'm making an effort to understand them. I've been giving this essay a re-read: http://jibbering.com/faq/faq_notes/closures.html
13
39437
by: Oleg Konovalov | last post by:
Hi, I am working on a web application which among other things uses DHTML, Java and Javascript. It populates web page based on the contents of the database (resultset), and next to each row there is a checkbox (v1) allowing to select that row for changes (e.g. delete, update, etc.) So we are creating an array of checkbox, correct ? Of course I have to check whether any of these checkboxes exist and if any of them got selected (checked)
0
1571
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi I have two updatepanels on an asp.net page and when there is a postback from one updatepanel it changes the non english characters in the other and displays some crap instead. Characters non english like áÁñÑnº1ªäÄà display like
26
3900
by: Jake Barnes | last post by:
I did a search on the newsgroup comp.lang.javascript. I was searching for "how to play a sound with Javascript". I'm somewhat suprised that the majority of entries are from the 1990s, and there are almost no posts from the last 3 years: http://groups.google.com/group/comp.lang.javascript/search?group=comp.lang.javascript&q=how+to+play+a+sound+with+Javascript&qt_g=Search+this+group Even after sorting by date, there don't appear any...
1
108757
Frinavale
by: Frinavale | last post by:
Introduction I've seen many questions asked about how to disable the browser's back button and in the past I've replied with "it's simply not possible". It's not a good idea to disable the back button anyways, if the user ventures away from your page then they wouldn't have this button at their disposal. The main reason people ask how to control or disable the back button is because they have a need to control sensitive (and/or) dynamic web...
12
78009
lifeisgreat20009
by: lifeisgreat20009 | last post by:
I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn't get much help so finally I am here.. Hoping of getting my problem solved. Please give me some idea where I am going wrong ?? I just want to retrieve data from my emp_mstr table and display it using my JSP file... The table emp_mstr is as follows :- CREATE TABLE EMP_MSTR( EMP_NO VARCHAR(10) PRIMARY KEY, PASSWORD...
0
8867
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8740
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9386
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9239
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9158
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9090
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6685
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4764
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2606
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.