Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // only queue when page slug where CF is located is true
- function contactform() {
- if(is_page(‘page-slug’)) {
- wp_register_script( 'jerrixit_contactform', get_stylesheet_directory_uri() . '/jerrixit.js', array( 'jquery' ) );
- wp_enqueue_script( 'jerrixit_contactform' );
- }
- }
- add_action( 'wp_enqueue_scripts', 'contactform' );
- // .JS file
- jQuery(function($){
- var max = 20;
- var checkboxes = $('input[type="checkbox"]');
- checkboxes.change(function(){
- var current = checkboxes.filter(':checked').length;
- checkboxes.filter(':not(:checked)').prop('disabled', current >= max);
- });
- });
Add Comment
Please, Sign In to add comment