Click to See Complete Forum and Search --> : Question: How to pass the values from a order form to a confirmable order form ?
Hi, this is the first time that i am posting here, and i got a few questions to ask regarding a certain script that I was looking at, particularly http://javascript.internet.com/forms/confirm-order.html
This is a typical order form, with the items being purchased and when the user hits order, another page pops up, indicating the items that were previously selected, coupled with a button to confirm the order and an email sent to (presumably) the user's address as well as the "company's" address.
the problem that i am facing here is that I made an entirely different Order Form that uses check boxes and text fields. I want to use a similar pop up window and confirm page, but I am having very little success in doing it.
I want to understand the use of the search() and how it works to transfer the values that i needed to another html page so that the user can print out the page and i can send that html page to the user's as well as the "company's" email account.
I would send the html file to show what i had accomplished in the basic template of the Order Form that i Had done, but I can only send a file. I have two files that i worked with, One which is the order form and the other is the confirm.html.
If anyone could help or take alook at the two files, please email me or post back on this thread. I really appreciate any advice or help on this problem of mine.
Thank you for taking the time to read this.
Bern
Khalid Ali
10-24-2003, 11:06 AM
What hapens is that when a GET request is placed,the data is appended to the URL and to separate data from the URL, browser by default, enters a ?(question mark) after the url. Following comes the rest of the data.
What search() function does is that it parses the URL and strips the URL part of the string and puts everything else in a string.
Now what you have to do from there is that parse the string (GET request sends data in fieldName=value format)
for field names and their corresponding values.
First of all i would like to thank you for replying quickly. I really appreciate the heads up on this.
another question i want to pose is this:-
1) so based on the weblink, i can just use the get, ? and search functions to implement what i need right ?
2) can i put this in ONE html instead of two ? in other words, i can use the script and combined it with another script that i had created and by default, shouldn't cause any problems ?
3) I was looking at the script, and i don't understand how the new html page (in this case confirm-order.html) pops up in the same window. I don't see teh code that would make it pop up, or am i overlooking at things ?
I want to appreciate my thanks again to you Ali, for replying quickly and answering my questions.
Bern
Khalid Ali
10-24-2003, 11:36 AM
Originally posted by Bern
1) so based on the weblink, i can just use the get, ? and search functions to implement what i need right ?
Bern
once you get the results by using search function , you will need to further parse the string to separate the fieldNames and their corresponding values.
Originally posted by Bern
2) can i put this in ONE html instead of two ? in other words, i can use the script and combined it with another script that i had created and by default, shouldn't cause any problems ?
Bern
I don't understand? did you mean that you do not want to point to thank you page and want do all this in the same page?
Originally posted by Bern
3) I was looking at the script, and i don't understand how the new html page (in this case confirm-order.html) pops up in the same window. I don't see teh code that would make it pop up, or am i overlooking at things ?
Bern
There is no code that will make it a popup,you will have to write the code if you want a popup thank you page.
if you want to see what is causing the confirmatory page to open then look in the code for the following part
<form name=orderform action="confirm-order2.html">
the action property is pointing to the second page (if in a form element a method attribute is missing then its default is GET)
for the first question, i want to combine two scripts in one html. I had trouble with combining the two scripts (in this case, the link had an order-form.html and confirm-order.html) into one big html.
Continuing with this question, would the link be sufficient enough to actually parse the string and convert it ?
second question i had in mind is this.
So by using Action (this is to reconfirm what i understood) i can point it to another page. but if i want to use a form, i have to use Get ?
Could you please give a sample from which i could refer to (my javascript if less than mediocre and i learned my javascripts through templates and samples). I would really appreciate the help.
is it possible that i could email you my two files ? perhaps that would shed some light on the questions that i am asking.
Bern
I want to give a heads up to Khalid who helped alot in answering the critical questions.
However, i am stuck at this point where i can't seem to find any functions that would help me to recognise certain keywords like field names and values. I tried to write out the string, just to see whether i could find anything to work with, yet it was unsuccessful, giving me a jumble of mumbo jumbo. (this is after using the unescape & escape function). Is there any code that would just print out the whole string without any trouble ?
thanks to anyone who read this and reply to this thread !
Bern
Please ignore the above message, I actually found out how to get rid of the problem. Thanks again for reading, since i can't seem to find the button to delete the previous message.
andaone
11-03-2003, 08:16 PM
I found the Confirmable Order Form to be exactly what I was looking for! I am right now customizing it for my site and testing it, but when I change the email address to my address, it does not deliver the email. It opens my thank youj page and this webpage: http://cgi.freedback.com/mail.pl
with this message:
THANK YOU! The information that you just entered has been sent to the Webmaster of the prior site, using the Freedback.com Free Feedback Form service. Your info will NOT be provided to the advertisers below unless you specifically choose to submit it to them. Please report all cases of abuse to abuse@Freedback.com (e.g., password and credit card scams). Note that AOL does not use Freedback.com to validate or otherwise collect your private password or financial data. (Why would they?)
(with ads)
but I don't get the email delivery.
Did I do something wrong?
Does it work for everyone else?
Thanks!!!
Pat
It actually works for me. The email thing that is, but i can't seem to put the information that i needed into the email, mainly the order form.
I am not sure how to do that either, and i was just wondering whether there were any ways to submit multiple emails too.
But it does work for ONE email. Not sure whether it would print out anything you ask for though.
Bern