Advertisement
vfontjr

firefox-default-value-work-around.js

Jul 21st, 2022
1,010
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. <script>
  2. jQuery(document).ready(function($) {
  3.     "use strict";
  4.     ( function($) {
  5.  
  6.         /* this function is a workaround for something going on with FoxPro
  7.          * the default values are not being set in FP, but it works in
  8.          * Safari and Chrome.
  9.          */
  10.         function masterminds_maybe_set_default_radio_values() {
  11.             if ( ! $('input[id^="field_w3cfrm_post_content_type-"], input[id^="field_w3cfrm_post_content_format-"]').is(':checked') ) {
  12.                 $('input[id="field_w3cfrm_post_content_type-0"]').prop("checked", true);
  13.                 $('input[id="field_w3cfrm_post_content_format-0"]').prop("checked", true);
  14.             }
  15.         }
  16.  
  17.         masterminds_maybe_set_default_radio_values();
  18.  
  19.     })(jQuery);
  20. });
  21. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement