WPIntell

Source evidence

Minimum number

Masks Form Fields · support · 2022-02-24T11:37:00+00:00

mixedsentiment
highseverity
0.82relevance
3replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

7 / 27 rows with source links

25.9% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
pickme resolved
Hi, Using this function: function custom_masks_form_fields() { ?> <script type="text/javascript"> jQuery(document).ready(function($){ $("input[name='money']").mask('000.000.000.000.000', { reverse: true }); }); </script> <?php } add_action('wp_footer', 'custom_masks_form_fields', 111); How can set a minimum number, ie a min amount of money, for example restrict the number to start from 0 ? Thank you This topic was modified 4 years, 3 months ago by pickme . This topic was modified 4 years, 3 months ago by pickme . This topic was modified 4 years, 3 months ago by pickme . This topic was modified 4 years, 3 months ago by pickme . Hi @pickme , Please try with the code below. function custom_masks_form_fields() { ?> <script type="text/javascript"> jQuery(document).ready(function($){ $("input[name='money']").attr("type","text").mask("000.000.000.000.000",{reverse:true}).on("blur, keyup, change",function(e){const money=parseInt($(this).val().replace(/\./g,""));if((money * money)==0){$(this).val("");}}); }); </script> <?php } add_action('wp_footer', 'custom_masks_form_fields', 111); When the value is zero, the script will clear the field. Hi @ivanpetermann This code worked as well. Thank you! This reply was modified 4 years, 3 months ago by pickme . Hi @ivanpetermann Is there a way to set a minimum number and a maximum number, in addition to restricting the entry starting with 0? The code above works for the 0. Below the minimum number, the number may be restricted entry or clear itself. Same for the number above the maximum number. Thank you This reply was modified 4 years, 3 months ago by pickme . This reply was modified 4 years, 3 months ago by pickme . This reply was modified 4 years, 3 months ago by pickme .

Comments

3 shown
Petermann 2022-02-24T17:17:00+00:00

Hi @pickme , Please try with the code below. function custom_masks_form_fields() { ?> <script type="text/javascript"> jQuery(document).ready(function($){ $("input[name='money']").attr("type","text").mask("000.000.000.000.000",{reverse:true}).on("blur, keyup, change",function(e){const money=parseInt($(this).val().replace(/\./g,""));if((money * money)==0){$(this).val("");}}); }); </script> <?php } add_action('wp_footer', 'custom_masks_form_fields', 111); When the value is zero, the script will clear the field.

pickme 2022-02-24T19:04:00+00:00

Hi @ivanpetermann This code worked as well. Thank you! This reply was modified 4 years, 3 months ago by pickme .

pickme 2022-02-25T22:27:00+00:00

Hi @ivanpetermann Is there a way to set a minimum number and a maximum number, in addition to restricting the entry starting with 0? The code above works for the 0. Below the minimum number, the number may be restricted entry or clear itself. Same for the number above the maximum number. Thank you This reply was modified 4 years, 3 months ago by pickme . This reply was modified 4 years, 3 months ago by pickme . This reply was modified 4 years, 3 months ago by pickme .