Pass form data onto next page as text - javascript

I have an email sign up form generated by our ESP plugged into a webpage. When the user clicks submit, it takes them to a custom confirmation page we have created. I would like to display the email address they submitted on the confirmation page, so it says something like, 'Thanks for joining, you will now receive emails at [email address]'. Our ESP does not provide a way to do this. Is there is a simple way I can grab the email address from the form and pass it to the next page with JavaScript?
I've tried the solutions presented here, but if I try to update the form tag, the form breaks: http://www.webdeveloper.com/forum/showthread.php?232612-Pass-Variables-from-one-page-to-another-JAVASCRIPT-HTML
I found this article online but I don't understand how the cookie will record only the email address or how to retrieve this information on the next page: http://webdesign.about.com/od/cookies/a/aa083198.htm
Here is the current form code on my page:
<script type="text/javascript" src="https://app.e2ma.net/app2/audience/tts_signup/1723547/4d1180e592869543e75486faa4eb9d23/37406/?v=a"></script>
<div id="load_check" class="signup_form_message">
This form needs Javascript to display, which your browser doesn't support. Sign up here instead
</div>
<script type="text/javascript">signupFormObj.drawForm();</script>
I have very limited understanding of JavaScript and no understanding of PHP so the more specific reply you could give, the better. Any help is greatly appreciated. Thank you.

since you are submitting a form, hence have access to the email adress on the server side, why don't you just output it?
Javascript looses connection between pages as soon as it unloads. Your attempt to do this with javascript is WAYYYYYY to complicated for something HTML1 was able to do.

Related

How can I transfer the information I get from the form to another page?

How can I show the information I got from the place where I entered the title and text on the announcement page?
repo:https://github.com/qswezy/spa1
We have added the form and we want to show it in the announcements
Forms usually have target page. So, this is the page that will receive your submitted data, usually in some type of POST array (if you submitted it as a post.) If this assumes JavaScript, you probably need to run an Express server to do this.

Submit a Login form using data received in another form

I have a login form in my webpage. How can I access data in the login form in my webpage and inject the received data in another third party login form which i don't have any end level access and auto-click submit button.
Your question is a little confusing, so let me try to understand:
you are trying to carry the information received from a form throughout multiple ".php" pages?
İf so, you can use the $_SESSION command. More information here, however this is briefly how you can use it.
You start with a
<?php
session_start();
$_SESSION["information"] = informationToCarry;
?>
By opening with a session_start at the beginning of every page, you will be able to retrieve that information with the same syntax
$_SESSION["information"];
Please be a little more clear next time,
Good Luck

Parse the email id from the email header using Javascript

I am sending an HTML email. In the content of that email, I have a submit button.
How do I make sure that the submit button was clicked by the same person to which the email was sent to and not some other person?
In order to achieve that, I will need to parse the email header and extract the email id from it using Javascript.
In short, how can we parse the email header in our Javascript code?
When you send an HTML email, you are just displaying an HTML formatted document to the user through their email client.
The Javascript code cannot parse the email header, in this case, since, the Javascript interpreter lies in the HTML document and doesn't know anything about the email. Anyways, if you want to retrieve the email id from the email header of an email which you have sent yourself, what don't you store it at the time of sending? But, this actually doesn't serve the purpose properly.
You cannot make sure that the submit button was clicked by the same person, since, he can always share the HTML document with somebody.
This type of authentication is not possible. Maybe, if you tell us the problem which you want to solve by this authentication, we can come up with some other form of authentication.
you cannot run JavaScript from your mail but you still can submit forms.
for tracking users you can add to the form action URL the query string with some random number and save this number in a BackEnd before composing the email.
if you have multiple recipients, you have to send the same mail multiple times to 1 recipient at a time with different tracking number in the form.

Can I Send an Email using ONLY Javascript Without Having to Click The Send Button on the Email Client?

I created a form in HTML and when the submit button is clicked the onclick event calls the following function:
function ProcessSubmition(){
var stringEmailBody=BuildEmailBody();
var stringTo=document.getElementById("SubmittersEmail").value;
var stringSubject = "My Subject Text";
window.location.href = "mailto:"+stringTo+"?subject="+stringSubject+"&body="+stringEmailBody;
}
There are two requirements to my project:
No PHP is allowed on our server.
The person filling out the form must not be able to edit the data which contains a calculate price.
The Problem:
When the function launches, the mail client window appears and displays the message constructed by the function and the user must click the "Send" button in the mail client window.
Unfortunately before the user clicks send, they can simply change the calculated price to a lower dollar amount which obviously is unacceptable.
Is there any way to hide the mail client window and auto-sent? Alternately is there any other method I could use to solve the problem?
Thank you for any help you can give me.
Short answer: No
The JavaScript code that runs in the context of a browser is client-side code that can be manipulated by the end-users. For that reason, you should never rely on client-side code to perform any sensitive operations.
Basically, you will need some server-side support to do what you are tyring to achieve or it will never be secure. Now, if it's dangerous for you that the users can tamper with your code, it would also be dangerous for them if your code could perform tasks such as sending e-mails on their behalf without any form of approval.
Even if you could talk directly to the mail client like you asked and make the email being sent automatically, there's nothing that would prevent users from editing the JavaScript source that generates the message and change the message content.
Alternative? If you will never be able to use any server-side technology, Maybe you could simply send the form details by e-mail and do the pricing calculations in another process afterwards.

How can I read the HTML contents of the file which contains a button

Folks, I have a HTML file which contains a button called "Email this content to me". Upon pressing this button, I want the complete HTML content of the file to be emailed to me.
Can someone tell me if there is a javascript function to do that. A short example would go a long way :)
Thanks in advance
You can't email by Javascript alone. You need some server side technology that will process the HTML form and email it (using CGI, PHP, ASP.NET, JSP or any other server side technology).
As long as the user has a proper mailto: handler set up, and the user is willing to actually send the email itself then yes, it is possible:
function handlerForClickEvent() {
var body = document.body.innerText; //no point in using innerHTML
location.href = "mailto:foo#example.com?subject=my%20subject&body="+ encodeURIComponent(body);
}
This will cause the default mail handler to be opened with a ready email containing the to:, subject: and body: fields.
All the user has to do is press [send].
Is the page dynamically generated? If so why not just insert this into the body of your mail?
If its not dynamically generated why not just insert the URL into the message section of the email.
Short answer: No.
For an email to be sent you need a serverside system (ie. Python/Java/.net) to make the SMTP request an populate the email, set sender, subject and receiver.
You'll need some of this information to be added in a html form (http://en.wikipedia.org/wiki/Form_(web)) that is posted to a serverside code.
Use google to search for example for the current serverside system you use.
..fredrik

Categories

Resources