Two issues –
validateForm is an existing javascript function in WordPress core, change it to something else. Always prefix things with a unique string to prevent these problems.
Your onsubmit needs return added: onsubmit="return your_function()"
Related Posts:
- Is it possible to reuse wp.media.editor Modal for dialogs other than media
- Plugin Form Submission Best Practice
- Handling results from data hooked into admin_post
- How to implement color picker from wordpress in my plugin?
- How to provide translations for a WordPress TinyMCE plugin?
- How-to implement admin Ajax inside an admin WP_List_Table?
- What is the recommended way to create plugin administration forms?
- Include third party Javascript library which is not included in WordPress
- How to Add a .js file Only in one specific Page Dynamically to Head
- How to trap “Publish” button to check for meta box validation?
- Pass javascript result to shortcode executer function
- Check spam in custom form – akismet
- The changes I make to an external JS file of my WP plugin are only applied after I clear my browser’s cache
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- Use js script from one plugin in another plugin
- Use a PHP file as action for a form in a WordPress plugin, what’s the correct way?
- Looking for callback function after Gutenberg is rendered?
- Can’t get JS code to work with shortcode
- Best Practices for Creating and Handling Forms with Plugins?
- How do I add a javascript file to all admin pages via a plugin?
- Gutenberg – What is the best way to save/update post meta?
- Prevent Javascript Facebook SDK Conflicts in plugin
- Plugin options page – form with two different submit buttons
- Print WordPress username id inside JavaScript
- Mixing Regular Javascript With jQuery in a Plugin
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- How to sanitize user input?
- Where to call wp_enqueue_script in a plugin with custom template?
- Is there an event or an other method that tells me the preview is loaded?
- How to add custom fields to the all users page
- WordPress Plugin with a shortcode that dynamically generates javascript. Can I use add_action without wrapping the javascript in a function?
- How to prevent UNDO on guternberg block editor
- Do I have to worry about useState causing a re-render?
- Creating a custom Gutenberg block with columns
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- wp.template() returns tags in Ajax response
- My WordPress plugin cannot load my JavaScript file
- add javascript files only when plugin is called?
- Avoid updating post when sending POST or GET request to post.php
- Inserting code to HTML view from a pop up initiated from visual view
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- admin_post equivalent for guest user?
- should i be checking for jquery before enqueing it in a plugin
- How can I add a simple custom field to my plugin?
- Loading custom js file on the admin page through plugin
- Custom Plugin – CSS works, JS doesn’t
- I am unable to save my data from a form
- Catching Form Submission in WordPress Admin Panel
- How to add a panel/box/widget/are/screen to the right side of edit post/page confusion
- Form using admin-post.php gives 404 after submission
- Service Worker Uncaught (in promise) DOMException
- Gutenberg – is it ok to load dependencies multiple times?
- Preventing double loading JS scripts (like React) when developing for Gutenberg
- About a programming language starts with [closed]
- Referencing files in JavaScript in WordPress Plugin
- A function that will remove HTML and tags from a string?
- Should I put my plugin javascript inline?
- Form submission to another page returning 404 error [duplicate]
- Lead form that submits to 2 external APIs
- wp.media libary pdf type
- Query String Filtering API
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- How to create a custom post-new.php page for plugin , no wp menu
- What happens/fires when you select a block in the editor?
- jQueryUI draggable doesn’t work in WordPress plugin
- Reading plugin settings in esnext wordpress block
- Dynamically modify content added to table via javascript
- Load script on frontend from widget plugin
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- Append php file to footer
- XMLHttpRequest to open PHP file responds with Missing Page
- Javascript scroll eventHandler only working when I’m logged in in WordPress
- Replace the WordPress Media Library Uploader
- Pass javascript result to shortcode executer function
- Filterable posts using categories
- Add language localisation to javascript alert?
- How to Maintain url on form submit
- form does not generate $_POST request
- How to display archive by selecting year and then selecting month
- Acessing WP functions in form submission handler
- Form and database, plugin development
- Can I use a hook other than ‘init’ to handle form submissions?
- wp_mail links are dead
- Best way to handle a form post in plugin
- Multi-part form and wp_redirect()
- Page reload occurs before request finishes
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- How do I access the contents of WordPress Classic editor in admin area with JavaScript?
- How to get the value entered in the input field in wordpres
- How can create a custom plugin to call my webapi after any registration or membership plugin functionality
- Insert meta-description into Yoast-SEO input-field via JavaScript
- Hook a search form anywhere on the site, using a custom plugin
- Plugin forms overwrite each other’s options
- Reinitiate Gutenburg’s blocks using javascript
- Javascript function defined in view.js not reachable from save.js
- How to move custom gutenberg block controls from settings to styles tab?
- How to use useSelect to retrieve the currently default fontFamily?
- How to apply a javascript code on certain parts of elementor made pages?
- useBlockProps() nests wrapper with class name inside block wrapper in the editor