For anyone interested, I was able to resolve it like so:
function form_checkboxes_validation(){
?>
<script type="text/javascript">
(function($){
$("#send-request").click(function(){
if(! $('input[name="form_fields[suite][]"]').is(':checked')) {
alert("Please select at least one suite!");
return false;
}
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'form_checkboxes_validation');
Related Posts:
- Clear form fields with jQuery
- Get a form action/url with jquery
- Twitter Bootstrap Modal Form Submit
- Validate form before submit jquery
- WordPress AJAX File Upload – FrontEnd
- jQuery and AJAX Not working with Select Form Element
- Add X meta box inputs based on form at top of meta box, how to do it right?
- Registration e-mail check with AJAX
- jQuery Validate wp_editor
- Gravity Forms not loading under https, jQuery is not defined
- Gravity list field override and adding javascript [closed]
- How do I setup nested repeatable option fields?
- Accept AJAX call with serialized form data
- Making the wordpress login form a jQuery dropdown
- Cannot prefill hidden Ninja Forms fields
- Frontend Post with JQuery AJAX to Php Issue
- Ajax form submit not working, returns 0
- jQuery will not work on page from snippet or file
- JQuery Counter Limit not working for WP Comment Textarea
- Required radio button does not validate in form, when clicked through Javascript/jQuery
- Duplicate “default” form with jQuery
- Converting a working AJAX form to work with WordPress
- jQuery forms & updating info
- How to setup multi-page using jquery?
- Is textarea always accesible throught textarea#content in wordpress dashboard for a specific page?
- Auto next upon clicking image without clicking Next button
- jQuery Validation plugin and Bootstrap 4 CSS classes
- Form validation before submitting
- Is not using admin-ajax to ajax submissions okay?
- $_POST empty in using new php file added to theme
- value not saving in the form when dynamically creating an input
- Customize wp-admin form custom fields
- Auto Select Child categories on Multiple Dropdown – Jquery
- Adding jQuery timepicker to contact form
- jQuery form plugin, submit in the wordpress way
- jQuery Live Form Validation in WordPress
- Contact Form 7 checkbox to add a new class to a div [closed]
- jQuery color picker function on change
- Submit a form using jQuery
- Adding placeholder attribute using Jquery
- wait() or sleep() function in jquery?
- Force a default browser on my android phone using a simple html shortcut page
- Ajax Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource
- Enable & Disable a Div and its elements in Javascript
- Which selector do I need to select an option by its text?
- Check if inputs are empty using jQuery
- The ‘describe’ keyword in javascript
- e.preventdefault(); not working
- How to empty input field with jQuery
- Using WordPress 3.5 Media Uploader in meta box?
- WordPress Ajax URL for function in functions.php
- Move WordPress native javascript to bottom of page?
- Lightbox popup on WooCommerce add_to_cart action
- AJAX function returning -1
- Is it worth updating WP admin to jQuery 1.5?
- Proper way to load a single post via Ajax?
- Trying to get single posts to load on the front page via ajax
- Ajax not firing properly using Firefox, but works in Chrome
- Get ACF value in external jQuery document
- Automatic jQuery accordion from header tags
- Adding a character counter to the excerpt metabox
- How to deregister a jquery version for a specific page?
- Enqueuing javascript files
- How to undo deregister script and use local versions?
- Can’t load a class into WordPress post editor’s content field
- How can I check email exists via a jquery keyup()?
- How to Dynamically Load Content Into Body of Bootstrap Modal Window?
- show/hide div with simple jQuery script [closed]
- Searching multiple tags and adding jQuery dependant script onto page template?
- TinyMCE 4 remove/add attributes for all images
- Validating a cloned/repeatable input (jQuery) [closed]
- Reload wordpress shortcodes
- I’m trying to set the cookie to my site to button on click action ,it is working on when user logged in .When user logged out it’s not working
- Do I need to use jQuery for my template?
- Invoking Jquery in a Plugin
- Why not working jquery show() function in wordpress? [closed]
- registering new jQuery after wp_deregister_script() not working
- Displaying an image’s alt title and caption inside a fancybox window. Working, but showing the same alt and caption for each image
- Problem Implementing parallax in header of bp-default theme
- Need workaround for insecure XMLHttpRequest endpoint request
- jQuery don’t working
- Load different post_thumbnail for smaller window width (jQuery,WordPress)
- Checking length of string in an admin area field onblur with jQuery
- My wordpress site is using local ip to point to jquery and other files, how to fix it?
- Blur.js with WordPress – Enqueued, but server not finding file
- Submitting form from input[type=file] dialog box
- JQuery script working locally on desktop, not working on WordPress + Divi
- Uncaught TypeError: Cannot read property ‘replace’ of undefined
- Can’t Target a Widget’s Elements using jQuery
- Uncaught TypeError for wp-auth-check in wpCompressionTest on Posts/Pages
- Multiple recaptcha validation
- Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()
- jQuery plugin is loaded correctly, but does nothing
- JQuery Login Dropdown not functioning in theme
- Retrieve customizer value using ajax or customizer api and print the value in theme
- WordPress version for this autocomplete jQuery code
- Custom counter when link is clicked in WordPress
- jQuery issue and wp_enqueue_script
- Integrating jSquares and Jquery with WordPress loop
- Can’t seem to check off a category checkbox with jquery?