Title: Simple Form using JQuery Plugin
Last modified: April 19, 2022

---

# Simple Form using JQuery Plugin

 *  [darrellwilde](https://wordpress.org/support/users/darrellwilde/)
 * (@darrellwilde)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/simple-form-using-jquery-plugin/)
 * Hi Guys
 * I just need some help embedding a simple html form on one of my wordpress pages.
 * So my form needs to submit to a certain url and then redirect to a Thank You 
   page.
 * Normally in a html page i’d use the following:
 *     ```
       <html>
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
       <title>Test Form - Overture</title>
       <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script> 
       <script src="https://malsup.github.io/jquery.form.js"></script> 
   
       <script> 
       $("form").ajaxForm({
       "clearForm": false,
       "resetForm": true,
       "beforeSubmit": function() {
       },
       "success": function(json) {
       if (json.success == true)
       {
       // Form has submitted successfully.
       alert("Thank you for getting in touch.");
       } else {
       for (name in json.errors) {
       $("form").find("[name$='" + json.errors[name] + "']").css("border-color", "red");
       };
       };
       },
       "error": function() {}
               }); 
       </script> 
       </head>
   
       <body>
   
       <form method="post" action="https://overturehq.com/formapi/webform/submit.json">
         <label>Name:</label>
       <input type="text" name="personName">
       <label>Email Address:</label>
       <input type="text" name="personEmailWork">
       <label>Phone Number:</label>
       <input type="text" name="personPhoneWork">
       <label>Event Date:</label>
       <input type="datetime-local" name="booking1Date">
       <label>What would you like to discuss with us?</label>
       <textarea name="personNote"></textarea>
       <input onclick="window.location.href = 'https://www.activetalentagency.com/booking-request-confirmation/';" type="submit" value="Send Enquiry">
       <input type="hidden" name="key" value="MTI4NzQxNTE1NzI=">
       </form>
       </body>
       </html>
       ```
   
 * However I cant get the JQuery script to run in WordPress. I think I may need 
   to add it to my themes functions.php or similar. If anyone could help that would
   be great.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsimple-form-using-jquery-plugin%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/simple-form-using-jquery-plugin/#post-15572687)
 * You integrate your own jQuery library, which is not necessary with WordPress 
   because WordPress already comes with jQuery. In addition, it is integrated incorrectly:
   via http instead of https, which is why all current browsers block this integration.
   By the way, this can be seen in the developer tools of the browser.
 * The question now is what exactly source code you have integrated where in WordPress?
   If you show us, we could tell you what you need to do differently.
 * One tip, however: you can integrate your own JavaScript via [https://developer.wordpress.org/reference/functions/wp_enqueue_script/](https://developer.wordpress.org/reference/functions/wp_enqueue_script/)
 *  Thread Starter [darrellwilde](https://wordpress.org/support/users/darrellwilde/)
 * (@darrellwilde)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/simple-form-using-jquery-plugin/#post-15572713)
 * [@threadi](https://wordpress.org/support/users/threadi/) thanks for the reply!
 * So at this moment in time all I have done is use a raw html element within my
   page to create the form.
 * Here is the page: [https://www.activetalentagency.com/booking-request-overture/](https://www.activetalentagency.com/booking-request-overture/)
 * Using the following code within the element:
 *     ```
       <form method="post" action="https://overturehq.com/formapi/webform/submit.json">
         <label>Name:</label>
       <input type="text" name="personName">
       <label>Email Address:</label>
       <input type="text" name="personEmailWork">
       <label>Phone Number:</label>
       <input type="text" name="personPhoneWork">
       <label>Event Date:</label>
       <input type="datetime-local" name="booking1Date">
       <label>What would you like to discuss with us?</label>
       <textarea name="personNote"></textarea>
       <input onclick="window.location.href = 'https://www.activetalentagency.com/booking-request-confirmation/';" type="submit" value="Send Enquiry">
       <input type="hidden" name="key" value="MTI4NzQxNTE1NzI=">
       </form>
       ```
   
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/simple-form-using-jquery-plugin/#post-15572731)
 * Then you have to add your JavaScript as described here: [https://developer.wordpress.org/reference/functions/wp_enqueue_script/](https://developer.wordpress.org/reference/functions/wp_enqueue_script/)
 * Very simple example using a child theme (also from the above page):
 *     ```
       function wpdocs_scripts_method() {
           wp_enqueue_script( 'custom-script', get_stylesheet_directory_uri() . '/js/custom_script.js', array( 'jquery' ) );
       }
       add_action( 'wp_enqueue_scripts', 'wpdocs_scripts_method' );
       ```
   
 * Or you can add it as an inline script via [https://developer.wordpress.org/reference/functions/wp_add_inline_script/](https://developer.wordpress.org/reference/functions/wp_add_inline_script/)
 * If you don’t have a child theme, you can also add the codes via a plugin like
   [https://de.wordpress.org/plugins/code-snippets/](https://de.wordpress.org/plugins/code-snippets/)
 *  Thread Starter [darrellwilde](https://wordpress.org/support/users/darrellwilde/)
 * (@darrellwilde)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/simple-form-using-jquery-plugin/#post-15572753)
 * [@threadi](https://wordpress.org/support/users/threadi/) I don’t have a child
   theme so would I be better using the code snippets plug-in?
    -  This reply was modified 4 years, 1 month ago by [darrellwilde](https://wordpress.org/support/users/darrellwilde/).
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/simple-form-using-jquery-plugin/#post-15572775)
 * Yes. Or develop your own plugin.
 *  Thread Starter [darrellwilde](https://wordpress.org/support/users/darrellwilde/)
 * (@darrellwilde)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/simple-form-using-jquery-plugin/#post-15572777)
 * [@threadi](https://wordpress.org/support/users/threadi/) ok great, or could I
   not just add it to my actual theme anyway? Whatever is the easiest method really
   as I’m not an expert on wordpress.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/simple-form-using-jquery-plugin/#post-15572788)
 * No, never change anything in the theme or plug-in files. As soon as an update
   is applied to them, your customisation is gone again.
 * If you need further support, you can look for someone to help you here: [https://jobs.wordpress.net/](https://jobs.wordpress.net/)
 *  Thread Starter [darrellwilde](https://wordpress.org/support/users/darrellwilde/)
 * (@darrellwilde)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/simple-form-using-jquery-plugin/#post-15572795)
 * [@threadi](https://wordpress.org/support/users/threadi/) of course! I’ll give
   the code snippets plug-in a go tomorrow and see how I get on.
 * It should be pretty straightforward using that plugin I assume.
 * Thanks for all your help!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Simple Form using JQuery Plugin’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 8 replies
 * 2 participants
 * Last reply from: [darrellwilde](https://wordpress.org/support/users/darrellwilde/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/simple-form-using-jquery-plugin/#post-15572795)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
