Title: Custom form processing issue
Last modified: August 21, 2016

---

# Custom form processing issue

 *  [cartoonsmart](https://wordpress.org/support/users/cartoonsmart/)
 * (@cartoonsmart)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/custom-form-processing-issue/)
 * **Topic**: custom jquery/ajax form in a sidebar template page
    **The [website](http://goo.gl/skhu1)**
 * Hi everyone,
    I made a custom form in a sidebar template page – a plugin is not
   an option. I got the validation working but the processing runs foul. Next I 
   will explain in more detail what I did.
 * Let me start off by saying: I am noob (and that’s probably stretching it). My
   problem – in short – is that a contact form validated with the [jquery validation plugin](http://docs.jquery.com/Plugins/validation),
   and submitted through ajax does not end up in my mailbox. And yes, I have a form
   processor php scrip attached but something goes wrong. But I don’t know what.
 * Now I have been searching the internets for an answer. Of course I don’t thoroughly
   understand the javascript and php stuff. None the less I did put the necessary
   scripts together in accordance with the many explanations that I have read.
 * **My own guess**
    Before I will show you the custom scripts I want to address
   what I think is going foul. I made a valid html form. I used the jquery validation
   plugin to use the validate function on the various fields. And I added some custom
   jquery to tell the validation plugin exactly what fields are required. On top
   of that I added ajax, via the [jquery form plugin](http://malsup.com/jquery/form/),
   so that the form doesn’t reload upon submittal.
 * Now the validation works – see for yourself [here](http://goo.gl/G6vBQ). And 
   as soon as all fields are filled out correctly, and I press submit ajax kicks
   in because I see the button value change as intended. After a short load – sending
   sequence – the button changes to ‘message send’. But I receive no email. And 
   I have checked my spam folder: it’s empty. In previous tests – with a different
   script – I did receive emails with the contact form values (but there were other
   issues).
 * I am using this contact form in a WordPress template. Perhaps it is the php processor?
   But I can’t see what’s wrong with that file.
 * Also in Firebug, under ‘console’ I see a GET string with the form values after
   submittal.
 * My question is. Can someone take a look at the form (because I think the post
   action might be wrong, the form processor is located in the template file), the
   custom jquery script and the php script? Plus after the form is successfully 
   submitted, via ajax, I would like the form to reset, to clear all fields; how
   would I do that?
 * Btw I read somewhere I can use a WordPress function to add the admin e-mailaddress
   in the php form processor – where you would normally put down the receivers emailaddress.
   Is this true? And how would I do this?
 * Any help is seriously appreciated. Thank you for your time.
 * You can check the script and code over at Pastebin:
    - **Sidebar template page containing the htlm form**
       [http://pastebin.com/0Ucn306n](http://pastebin.com/0Ucn306n)
    - **Custom jquery form validation script**
       [http://pastebin.com/xxPdV7eL](http://pastebin.com/xxPdV7eL)
    - **Php form processor**
       [http://pastebin.com/1LKVPx2v](http://pastebin.com/1LKVPx2vhttp://)

The topic ‘Custom form processing issue’ is closed to new replies.

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)
 * [validation](https://wordpress.org/support/topic-tag/validation/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [cartoonsmart](https://wordpress.org/support/users/cartoonsmart/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/custom-form-processing-issue/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
