• Resolved jmcginnsher1

    (@jmcginnsher1)


    I decided I wanted to build a simple plugin for a contact form for future projects that I will work on. The purpose of the plugin was to send an email containing the data to the admins email address, save form submissions in the database and display them in WP dashboard.

    So far the following is working:
    1. Plugin is appearing in plugins section of WP dashboard
    2. Once the plugin is activated – a new menu item for displaying form responses is added to the WP dashboard and the form displays on the website itself.
    3. Before adding the JQuery validation / Ajax – the form was submitting to the database / WP dashboard and sending and email to the admins email address.
    However this isn’t working anymore for some reason.
    4. If you try to submit the form without filling in all the fields, validation messages appear until all fields have been filled in.
    5. An ajax request shows a success / error message when the message has been sent / not sent.

    The only issue and the big issue that I am having at the minute is saving the data from the form into the database, displaying the data in the WP dashboard and sending an email to the admin.

    If someone could help me get this working it would be much appreciated. Also I am aware of the security issues around building your own plugins – could someone let me know if I have correctly sanitized all data etc.

    I have included all code in the pastebin links below.

    * Code for plugin *

    * Code for JQuery validation / Ajax *

    * Code for form *

    * Code for displaying form submissions *

    Thanks for all help in advance.

  • The topic ‘WordPress Plugin Development – Data in form wont save to DB / WP dashboard’ is closed to new replies.