Form Questions
I need to do two things to my website:
1.) How do I send a "Thank You" e-mail to the user after a form has been submitted?
2.) How do I require fields to be entered and generate an error when they are not?
Thanks!
Web Development
I need to do two things to my website:
1.) How do I send a "Thank You" e-mail to the user after a form has been submitted?
2.) How do I require fields to be entered and generate an error when they are not?
Thanks!
by sparkytd
First, to send a thank you email, the easiest and quickest method is to use a scripting language(ie. perl, php, coldfusion, asp), where usually one is available. HTML can do a form post to email where the form content is sent via an email, but for you to do something that looks half nice, it would take a lot of javascripting, more than it's worth.
Second, use javascript to do client side validation. If you are using a server-side scripting language, you can use the built in functions of that. But, let's say your using javascript, the standard check to make sure a text box is not empty would be:
if(document.form.textbox.value == ""){
alert("You must fill in the text box");
document.form.textbox.focus();
return false;
}
whereform and textbox are the names of your form and textbox. A good tutorial site for this would be at www.webmonkey.com
This discussion is closed to new replies.
Sort by Trending