vfontjr icon

firefox-default-value-work-around.js

vfontjr | PRO | 07/21/22 09:55:47 AM UTC | 0 ⭐ | 1335 👁️ | Never ⏰ | []
PHP |

760 B

|

None

|

0 👍

/

0 👎

<script>
jQuery(document).ready(function($) {
    "use strict";
    ( function($) {
 
        /* this function is a workaround for something going on with FoxPro
         * the default values are not being set in FP, but it works in
         * Safari and Chrome.
         */
        function masterminds_maybe_set_default_radio_values() {
            if ( ! $('input[id^="field_w3cfrm_post_content_type-"], input[id^="field_w3cfrm_post_content_format-"]').is(':checked') ) {
                $('input[id="field_w3cfrm_post_content_type-0"]').prop("checked", true);
                $('input[id="field_w3cfrm_post_content_format-0"]').prop("checked", true);
            }
        }
 
        masterminds_maybe_set_default_radio_values();
 
    })(jQuery);
});
</script>

Comments