{"id":15572396,"date":"2022-04-19T18:23:35","date_gmt":"2022-04-19T18:23:35","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/simple-form-using-jquery-plugin\/"},"modified":"2022-04-19T18:23:35","modified_gmt":"2022-04-19T18:23:35","slug":"simple-form-using-jquery-plugin","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/simple-form-using-jquery-plugin\/","title":{"rendered":"Simple Form using JQuery Plugin"},"content":{"rendered":"<p>Hi Guys<\/p>\n<p>I just need some help embedding a simple html form on one of my wordpress pages.<\/p>\n<p>So my form needs to submit to a certain url and then redirect to a Thank You page.<\/p>\n<p>Normally in a html page i&#8217;d use the following:<\/p>\n<pre><code>&lt;html&gt;\n&lt;head&gt;\n&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=iso-8859-1&quot;&gt;\n&lt;title&gt;Test Form - Overture&lt;\/title&gt;\n&lt;script src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.7\/jquery.js&quot;&gt;&lt;\/script&gt; \n&lt;script src=&quot;https:\/\/malsup.github.io\/jquery.form.js&quot;&gt;&lt;\/script&gt; \n \n&lt;script&gt; \n$(&quot;form&quot;).ajaxForm({\n&quot;clearForm&quot;: false,\n&quot;resetForm&quot;: true,\n&quot;beforeSubmit&quot;: function() {\n},\n&quot;success&quot;: function(json) {\nif (json.success == true)\n{\n\/\/ Form has submitted successfully.\nalert(&quot;Thank you for getting in touch.&quot;);\n} else {\nfor (name in json.errors) {\n$(&quot;form&quot;).find(&quot;[name$=&#039;&quot; + json.errors[name] + &quot;&#039;]&quot;).css(&quot;border-color&quot;, &quot;red&quot;);\n};\n};\n},\n&quot;error&quot;: function() {}\n        }); \n&lt;\/script&gt; \n&lt;\/head&gt;\n\n&lt;body&gt;\n\n&lt;form method=&quot;post&quot; action=&quot;https:\/\/overturehq.com\/formapi\/webform\/submit.json&quot;&gt;\n  &lt;label&gt;Name:&lt;\/label&gt;\n&lt;input type=&quot;text&quot; name=&quot;personName&quot;&gt;\n&lt;label&gt;Email Address:&lt;\/label&gt;\n&lt;input type=&quot;text&quot; name=&quot;personEmailWork&quot;&gt;\n&lt;label&gt;Phone Number:&lt;\/label&gt;\n&lt;input type=&quot;text&quot; name=&quot;personPhoneWork&quot;&gt;\n&lt;label&gt;Event Date:&lt;\/label&gt;\n&lt;input type=&quot;datetime-local&quot; name=&quot;booking1Date&quot;&gt;\n&lt;label&gt;What would you like to discuss with us?&lt;\/label&gt;\n&lt;textarea name=&quot;personNote&quot;&gt;&lt;\/textarea&gt;\n&lt;input onclick=&quot;window.location.href = &#039;https:\/\/www.activetalentagency.com\/booking-request-confirmation\/&#039;;&quot; type=&quot;submit&quot; value=&quot;Send Enquiry&quot;&gt;\n&lt;input type=&quot;hidden&quot; name=&quot;key&quot; value=&quot;MTI4NzQxNTE1NzI=&quot;&gt;\n&lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<p>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.<\/p>\n","protected":false},"template":"","class_list":["post-15572396","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/15572396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/15572396\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=15572396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}