I am designing a website and I am at the contact section. I am creating a form where the person can put their name, number, message, etc. I want to design it so that when they push send, it will send to my email but I am unsure on how to do this. Here is what my send button code is now: <a class="button" href="#" onClick="document.getElementById('contact-form').submit()">Send </a> I believe that after the onClick= is the location where i should be inserting my email but i tried and it isnt working. it just refreshes the page and I receive no email. Please let me know what I should try! THank you!
So you need to use php mail function and pass the values which was insert in text fields. If you want my help PM me..
You should NOT be using an anchor or javascript for that!!! That's what an input[submit] inside your form is for... which will submit to whatever action you set in the form. Though without seeing your actual code so far, you've tread into "this is why we can't help you" territory. But really, that is the LAST way you should EVER even be considering submitting a form. Of course, as ashishkg suggested, a form is USELESS without server-side code to process it, like PHP or ASP... you can't submit an e-mail client-side using javascript OR a form. The form data has to be submitted to some form of code on the server which then sends the e-mail.
PM me and I'll send you the script with explanation... I tried to post the script for you, but my HTML is "off" and it wouldn't show up.