We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
HTML help?
Options

recyclingbox
Posts: 105 Forumite
in Techie Stuff
Hi, i am producing a small website as a way of learning CSS and HTML (for fun - not as a career move!) anyway, i have a problem with submitting a form. I would like the user to submit a form asking for their name and e-mail address for inclusion on a mailing list. I can get the submit to work fine using this piece of simple HTML code:
<form action="[EMAIL="******@*********.com"]MAILTO:******@*********.com[/EMAIL]" method="post" enctype="text/plain">
Name:<br />
<input type="text" name="name" value=" name" size="30" /> <br />
e-Mail:<br />
<input type="text" name="mail"
value="your e-mail" size="30" />
<br />
Comment:<br />
<input type="text" name="comment"
value="your comments" size="50" />
<br /><br />
<input type="submit" value="Send" />
<input type="reset" value="Reset" />
</form>
The problem i have is that when the submit button is pressed, the info is transferred to my e-mail ok, but i would then like to follow this up with a pop-up or another page that says 'thankyou' so the user knows the info has been sent. Otherwise the form just 'sits' there and the user wouldn't necessarily be sure if the data had gone or not!
Is this possible in HTML? any help or advice anyone could give me would be gratefully appreciated.
Thanks
Recycler
<form action="[EMAIL="******@*********.com"]MAILTO:******@*********.com[/EMAIL]" method="post" enctype="text/plain">
Name:<br />
<input type="text" name="name" value=" name" size="30" /> <br />
e-Mail:<br />
<input type="text" name="mail"
value="your e-mail" size="30" />
<br />
Comment:<br />
<input type="text" name="comment"
value="your comments" size="50" />
<br /><br />
<input type="submit" value="Send" />
<input type="reset" value="Reset" />
</form>
The problem i have is that when the submit button is pressed, the info is transferred to my e-mail ok, but i would then like to follow this up with a pop-up or another page that says 'thankyou' so the user knows the info has been sent. Otherwise the form just 'sits' there and the user wouldn't necessarily be sure if the data had gone or not!
Is this possible in HTML? any help or advice anyone could give me would be gratefully appreciated.
Thanks
Recycler
0
Comments
-
You can use the Javascript onSubmit() and then find out the Javascript command for going to a new page. I think its something like window.location(location) but Im not sure0
-
Oh, and your email will get spammed to death if you have your email address in your source code. Much safer to use PHP mail() or something that is server side0
-
Hi recyclingbox,
It is bad practice to have a form submit directly to an email address like that. The problem with that is the user needs to have an email client setup on their computer for it to send through.
What you should do is have the form submit to a server side script such as a PHP or ASP/ASP.NET script which can take the inputted data and email it to you, then also display a friendly thankyou message to the user.
Let me know if you need any help with that.0 -
cheers for the guidance, guess i will have to expand my learning beyond HTML! i will investigate the PHP route - more learning and time in the library. thanks 182guy i may be back but i will see if i can figure it out on my own - may help me to learn it better.
Cheers0 -
No worries, good luck!0
-
If you need a brief HTML/CSS/PHP/JavaScript tutorial/reference, https://www.w3schools.com is pretty good.0
-
try free this site for html forms
http://www.123contactform.com/0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.8K Banking & Borrowing
- 253K Reduce Debt & Boost Income
- 453.5K Spending & Discounts
- 243.8K Work, Benefits & Business
- 598.6K Mortgages, Homes & Bills
- 176.8K Life & Family
- 257.1K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards