2

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 basic 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

Joel
  • 2,691
  • 7
  • 40
  • 72
  • what they do with the info on the server side (such as storing it in a database) is completely non-related to the jquery code as such. if there are any of the examples you've found that you like, you can use them, and just send yourself an email, where the examples save to db. if sending the email is what you're facing a problem with, you should start a new question on how to send emails from your site, and in that question, you should specify what server side language you're using (php, asp.net...). – David Hedlund Feb 01 '10 at 08:51
  • ok. Makes sense. I've been staring at the computer for 16 hours now, so I'll have to do that in the morning. Thanks for the help. – Joel Feb 01 '10 at 08:54

2 Answers2

1

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.

Tahir Akhtar
  • 11,385
  • 7
  • 42
  • 69
0

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

Pantherius
  • 15
  • 1