I'm just looking for a form that someone will put in their email and submit and that's it. They stay on the same page with ajax, and I get emailed the submission. I don't need to save it in a database. I would like to perform bas开发者_Python百科ic check to validate that there is a "2" and a "." in the address and there will be text put in a div saying "your email was sent". but that is all.
Anyone seen anything like that? I saw a few, but they all just input the info to a database.
I'm using jquery.
Thanks! Joel
Just use the jQuery ajax form submission methods and handle the email sending in a server-side script.
You can not send emails directly from JavaScript. You will have to submit the form to your own or a third-party server to get the email sent out. Also note that AJAX won't work with third-party servers due to cross-domain security restriction but you achieve same effect by using and iframe to submit the form.
However, it is an old thread, but there is no accepted solution. You can simply create a HTML form with CSS, then extend it with some jQuery that will handle the validation and the form request. If you would like to send email notification about the submission, you need to manage it via PHP. The following free plugin provides all of these options, that has been mentioned above.
Free Simple Signup Form
You may also check out this list, that contains 10 different jQuery Signup Forms:
10 jQuery Signup Form Demos
精彩评论