• Resolved jmindl

    (@jmindl)


    Hello,

    I would like o add currency symbol for number field (not calculated) and if somebody will type number symbol will automatically move to the right. I am not looking for placeholder value. Is there any possibility for this?

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @jmindl,

    The correct in this case would be use currency fields instead numeric ones. The currency field allow you define the currency symbol and text, and configure the field to format dynamically the value entered by the user.

    Best regards.

    Thread Starter jmindl

    (@jmindl)

    Thanks a lot for very quick response. Great support.
    This works. One more question for potential modification:

    1. If I click to this field where is predefined for ex: 0 $ I need to select this value and replace it by new number. Is there any way if I click to this field and it will be automatically cleared and if I finish typing currency character will be added to the end of the field?

    2. There is automatic added 2 decimals digits to the end of this field. Is there any way how to change this to round it to integer?

    Thanks again

    Plugin Author codepeople

    (@codepeople)

    Hello

    Q: If I click to this field where is predefined for ex: 0 $ I need to select this value and replace it by new number. Is there any way if I click to this field and it will be automatically cleared and if I finish typing currency character will be added to the end of the field?

    A: Simply tick the checkbox in the field’s settings, to define the default value as placeholder.

    Q: There is automatic added 2 decimals digits to the end of this field. Is there any way how to change this to round it to integer?

    A: I’m sorry, the current version of the plugin converts the currency values with two decimal places, however, there is an alternative.

    Insert a “HTML Content” field in the form with the following piece of code as its content:

    
    <script>
    jQuery(document).on('change','.cff-currency-field input',function(){
    	var v = this.value;
    	this.value = v.replace(/\.\d*$/,'');
    });
    </script>
    

    and that’s all.
    Best regards.

    Thread Starter jmindl

    (@jmindl)

    Hello,

    I tried this to add, however this doesn’t work.

    Plugin Author codepeople

    (@codepeople)

    Hello

    As your currency fields were configured to display the currency symbol at the end, the previous piece of code should be modified as follows:

    
    <script>
    jQuery(document).on('change','.cff-currency-field input',function(){
    	var v = this.value;
    	this.value = v.replace(/\.\d*/,'');
    });
    </script>
    

    Best regards.

    Thread Starter jmindl

    (@jmindl)

    Hello,
    I tried several modification of this, however this is not working as I expected.
    There is predefined value in currency field “0 K?” (Czech crowns).
    What I want is that if somebody just a click on the field predefined value will be cleared and he can immediately type exact value.

    How this is running now is that I need to select predefined value and delete is or replace by correct number.

    Is this possible?

    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hello @jmindl,

    You simply should tick the checkbox: “Use predefined value as placeholder” in the field’s settings.

    Best regards.

    Thread Starter jmindl

    (@jmindl)

    Thanks, however when I check “Use predefined value as placeholder” stopped to be visible and symbol and field is empty now.

    Plugin Author codepeople

    (@codepeople)

    Hello @jmindl,

    Please, ensure to be installed the latest update of the plugin.

    Best regards.

    Thread Starter jmindl

    (@jmindl)

    Hello @codepeople

    I have latest version of 5.0.320 developer

    Plugin Author codepeople

    (@codepeople)

    Hello @jmindl,

    The latest version number is the 5.0.322 and includes changes in the currency and number controls.

    Please, if you need additional support for the paid versions of the plugin, you need to create a ticket in my private website:

    https://cff.dwbooster.com/contact-us

    Best regards.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Automatic currency symbol for number’ is closed to new replies.