Hi All,
I'm trying to do the following:
1) ON a php page, calculate fees based upon user entires. I'm calculating it in a javascript function and that is working well. However, I need to take that calculated amount and pass it to a new page on redirect. something like this:
[PHP] <input type="hidden" name="redirect" value="http://www.pagename.co m/v3/payment_pg.php? FeeCalcTotal=" & chargetotal& " " >[/PHP]
"chargetota l" is set as a hidden variable like this:
[PHP]<input TYPE="hidden" NAME="chargetot al" value = "">[/PHP]
and I am attempting to set it in my javascipt function like this: -
FeeCalcTotal = (Witness1Fee + Witness2Fee + Witness3Fee + Witness4Fee)* Discount;
-
-
document.form1.chargetotal.value = FeeCalcTotal
Two things are happening when the submit button is pressed. First, this happens:
[PHP]<form name="form1" method="post" action="/cgi/formmail">[/PHP]
Then, the redirect happens
Am I doing this correctly? I'm used to doing this sort of thing on web pages that live on our own servers - this is for somebody's individual website.
Thanks in advance for your help!
Happy Friday!
JCC
9 2577
No PHP in sight! This thread belongs in the HTML/JavaScript forum. So I will move it there.
moderator
hsriat 1,654
Recognized Expert Top Contributor
Hi All,
I'm trying to do the following:
1) ON a php page, calculate fees based upon user entires. I'm calculating it in a javascript function and that is working well. However, I need to take that calculated amount and pass it to a new page on redirect. something like this:
[PHP] <input type="hidden" name="redirect" value="http://www.pagename.co m/v3/payment_pg.php? FeeCalcTotal=" & chargetotal& " " >[/PHP]
"chargetota l" is set as a hidden variable like this:
[PHP]<input TYPE="hidden" NAME="chargetot al" value = "">[/PHP]
and I am attempting to set it in my javascipt function like this: -
FeeCalcTotal = (Witness1Fee + Witness2Fee + Witness3Fee + Witness4Fee)* Discount;
-
-
document.form1.chargetotal.value = FeeCalcTotal
Two things are happening when the submit button is pressed. First, this happens:
[PHP]<form name="form1" method="post" action="/cgi/formmail">[/PHP]
Then, the redirect happens
Am I doing this correctly? I'm used to doing this sort of thing on web pages that live on our own servers - this is for somebody's individual website.
Thanks in advance for your help!
Happy Friday!
JCC
Are you redirecting to http://www.pagename.co m/v3/payment_pg.php? FeeCalcTotal=ch argetotal in the end of the PHP code of /cgi/formmail/index.php ?
Are you redirecting to http://www.pagename.co m/v3/payment_pg.php? FeeCalcTotal=ch argetotal in the end of the PHP code of /cgi/formmail/index.php ?
Hi,
This is the block that has all the form actions: -
-
<form name="form1" method="post" action="/cgi/formmail">
-
<input type="hidden" name="required" value="AttyName, AttyStreet, AttyCity, AttyState, AttyPhone">
-
<input type="hidden" name="missing_fields_redirect" value="http://www.website.com/v3/fail.php">
-
<input type="hidden" name="subject" value="PrivateSummons">
-
<input type="hidden" name="email" value="Email">
-
<input type="hidden" name="recipient" value="webform@website.com"/>
-
<input TYPE="hidden" NAME="chargetotal" value = "">
-
-
<input type="hidden" name="redirect" value="http://www.website.com/v3/payment_pg.php?FeeCalcTotal=" & fees& " " >
So, things should happen when "Submit" happens, 1) a post to ="/cgi/formmail and then a redirect to payment_pg with the value passed to that page somehow
Thanks!
JCC
hsriat 1,654
Recognized Expert Top Contributor
Add this to the end of your PHP in cgi/formmail/
[php]header("Locatio n: ".$_POST['redirect'].$_POST['chargetotal']);[/php]
That is how much I could understand your problem.
Add this to the end of your PHP in cgi/formmail/
[php]header("Locatio n: ".$_POST['redirect'].$_POST['chargetotal']);[/php]
That is how much I could understand your problem.
Thanks for your input. Forgive my struggle with this, but this is completely out of my comfort zone and am trying to help a friend. So, it should like this?:
[PHP] <form name="form1" method="post" action="/cgi/formmail" header("Locatio n: ".$_POST['redirect'].$_POST['chargetotal']);
>[/PHP]
Then I assume I will need to add a "GET" to the payment page?
hsriat 1,654
Recognized Expert Top Contributor
Ok... Leave everything apart, tell me the whole story first, what you actually want to do.
I'll try to recapitulate.
You have a form that must be submitted (using POST) to "/cgi/formmail", passing the required values in hidden fields with a prescribed name.
This formmail function gets the form with the hidden fields in its $_POST array. It will pprocess the values from the $_POST array and redirect them to the site of which the name is stored in hidden field 'redirect'.
I guess that will work. The question is if the JavaScript calculated amount is correctly stored in the value of the hidden form field 'chargetotal'.
Does that sum it up?
Ronald
Ok... Leave everything apart, tell me the whole story first, what you actually want to do.
OK, we'll start over.....
This site is a place for a customer to enter certain information to request services. The services have fees associated with them and they are based upon location. So, I have a bunch of Javascript that grabs the inputted city values and ends up calculating one fee amount (this is working fine).
When the customer clicks submit, three things should happen:
1) javscript calculation is performed (working)
2) calculation is stored in a hidden variable (might be working)
3) there is a method post to /cgi/formmail
4) there is a redirect to payment_pg.php page. The javascript calculation amount needs to be carried over to this page somehow
So, I think i have 2 issues - a) assiging the calculated value to a variable and b) sending that variable to the next page
Hope this is a little clearer!
I'll try to recapitulate.
You have a form that must be submitted (using POST) to "/cgi/formmail", passing the required values in hidden fields with a prescribed name.
This formmail function gets the form with the hidden fields in its $_POST array. It will pprocess the values from the $_POST array and redirect them to the site of which the name is stored in hidden field 'redirect'.
I guess that will work. The question is if the JavaScript calculated amount is correctly stored in the value of the hidden form field 'chargetotal'.
Does that sum it up?
Ronald
Hi Ronald,
I'm skeptical about the 'chargetotal' field as well. I am assigning it in Javascript and used an 'alert" to see if it displayed the value. It does, but I'm not sure it works on the form itself
She actually wants the values posted to the payment_pg.php page
Thanks,
JCC
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: wk6pack |
last post by:
Hi,
I have a problem and not quite how to go about solving it.
I have a form written in asp. I wish to submit the form and have the server
return back to the same page without actually refreshing the page.
I know I could write a form, submit it and go to another page.
I've searched the web and I see something about HTTP Status code of 204
|
by: viktor |
last post by:
Hi ,
I have a small problem.How can I pass value from form thru a few pages. I
try with hidden field but my second page just validate and redirect to other
one and when I use Request.Form("field") it's nothing coming back.
Any help please.
thanks
|
by: Paul |
last post by:
What I am trying to do is as follows.
I have a page with 3 links,that direct the user to 3 different pages when selected after login.
So all link selections will first direct the user to a login page. Once the user logs in then they are directed to the appropriate link.
So for all 3 links they all go to a login page, but each link must pass information to the login in page, specifically the page to go to after login takes place.
--
Paul G...
|
by: macyp |
last post by:
I have to pass values from one aspx page to another. The controls I
have in the first page are:
a textbox, 3 drop down lists, and 2 check boxes, and a submit button.
It is a search page, and the users need not enter values in all the
controls. they can leave the textbox blank, and select values from one
drop down, or any other combinations.
I am trying to pass values with the help of session variables. But I
have multiple if else...
|
by: Shapper |
last post by:
Hello,
I am working on an ASP.NET/VB web site.
I have several links including menu links.
Considerer a want to load a page named page.aspx.
I can do it using javascript. Or using this code:
Sub loadPage(sender As Object, e As System.EventArgs, pageURL as
String)
| |
by: Coleen |
last post by:
Hi all :-)
I need to redirect to multiple pages on click of a transmit button, without
redisplaying each page. This redirection is to capture session variables
that are created on each page and pass them to the main page to be
displayed. We are actually NOT using session variables, but storing the
values in a temporary table. The problem is that the values don't get
stored in the temporary table unless the user goes to each page...
|
by: scottyman |
last post by:
I can't make this script work properly. I've gone as far as I can with
it and the rest is out of my ability. I can do some html editing but
I'm lost in the Java world. The script at the bottom of the html page
controls the form fields that are required. It doesn't function like
it's supposed to and I can leave all the fields blank and it still
submits the form. Also I can't get it to transfer the file in the
upload section. The file name...
|
by: antonyliu2002 |
last post by:
Let me try to make clear what my concern is. I think it is a pretty
interesting one, which I think of while I am developing my web
application.
I have an authenticated/authorized web application. People have to
login from http://mydomain.com/ to access the information on my site.
For now, this is working fine. People cannot bypass the login form,
any attempt to check out a page (if they happen to know the file name)
will be...
|
by: m1post |
last post by:
Hi,
I'm very much a novice, and wondered if someone could help. I'll try to be as specific as possible, but don't waant you to have to read too much.
I have 2 pages in the sequence. 1st allows customers to login, passing control to the 2nd, which on entry returns their balance details from my DB (using their Reference 'BookingRef = Request.form("txtBookingRef")') and displays an additional section allowing them to enter an amount of a part...
|
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
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...
|
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,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |