I have a number field where if I enter a value with a comma (example: 12,5) it gives me an error to insert a valid numeric value. if I enter the number with the dot (ex. 12.5) it returns me as correct.
for my needs I need to insert the value with a comma, see screenshot
many thanks
Aldo
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
There is no way to allow comma to numeric/number field.
If you really want to allow comma to your number field then the workaround I should suggest is covert your existing number field to a single-line text field that will allow you to add both number and comma - this is the only workaround I think of.
=> https://toolset.com/documentation/user-guides/custom-content/convert-existing-custom-types-and-fields-to-types-control/#converting-custom-fields
You can use the Form's API hooks like "cred_form_validate" to validate the field to check it has only numbers and comma:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
OR
you can use the "cred_before_save_data" and remove the unwanted characters before it gets saved.
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_before_save_data
My issue is resolved now. Thank you!