Finished retrieve each value of a form in JS and PHP , and re-write the labels in the content of email. With jQuery Simple Contact Form, you can install an ajax contact form on your website, writing only the form html code and one js code line. Email is generated and send by the plugin (php file included) .
The plugin keeps the form’s labels in the email sended, using their “for” attribute. jQuery Simple Contact Form can check required and email fields too, and add a custom class error to the wrong elements. Many options can be configured by parameters or CSS class.
Exemple : $(‘form’).simpleContactForm();
Parameters List :
clearAfterSend : Boolean | Clear form fields after sending the email senderEmail : String | Sender e-mail url : String | Url to php target file. If empty, the plugin use the action form url. type : String | Ajax type, ‘post’ or ‘get’ subject : String | E-mail subject clearAfterSend : Boolean | Clear the form elements after send errorClass : String | Error CSS class success : Function | Function executed after sending
Presets CSS Class List :
required : If is an empty value, the form don’t send email, and add the errorClass to the element. email : If isn’t an email, the form don’t send email, and add the errorClass to the element. senderEmail : Replace the senderEmail parameter by this element value. If there’s no senderEmail class and no senderEmail option, the senderEmail will be the last email input value.