public static function print_ori_perc_field() { $field_name = 'ori_perc'; echo '<b>' . self::prepare_pro_label(__('Original Percentage', 'nelioab'), false) . '</b><br><br>'; printf('<input type="range" id="%1$s" name="nelioab_settings[%1$s]" min="55" max="95" step="5" value="%2$s" %3$s /><br>', $field_name, NelioABSettings::get_original_percentage(), self::get_pro_details()); ?> <span <?php echo self::get_pro_details('description'); ?> id="value_<?php echo $field_name; ?> "></span> <script type="text/javascript"> jQuery("#algorithm").on("change", function() { var option = jQuery("#<?php echo $field_name; ?> ").parent().parent(); if ( jQuery(this).attr('value') == '<?php echo NelioABSettings::ALGORITHM_PRIORITIZE_ORIGINAL; ?> ' ) option.show(); else option.hide(); }); jQuery("#algorithm").trigger("change"); jQuery("#<?php echo $field_name; ?> ").on("input change", function() { var str = "<?php $str = __('<strong>{value}%</strong> of your visitors will see the original version of the experiment.<br>The rest of the users will see the other alternatives.', 'nelioab'); $str = str_replace('"', '\\"', $str); echo $str; ?> "; var value = jQuery(this).attr('value'); str = str.replace( '{value}', value ); jQuery("#value_<?php echo $field_name; ?> ").html(str); }); jQuery("#<?php echo $field_name; ?> ").trigger("change"); </script> <?php }