Copy link to clipboard
Copied
Is there a way or script to type a dollar amount into a field and have that same field show 15% of the dollar figure entered?
In other words, if I type $1,000 into the field I want it to calculate 15% of $1,000 and show $150.
Any help would be appreciated. Thank you.
That code would work but it will keep calculating *.15 every time there is change in form.
Try using this as "Validation" script:
event.value = event.value*.15;
Copy link to clipboard
Copied
Yes, you can try something like this:
Open the "Prepare Form" tool, right-click on that textfield and select "Properties" from the context menu.
You may go to the "Format" tab and in the "Select format category" dropdown menu choose "Number".
Below that, in the Number Options section select 0 for decimal places and $ for the currency symbol.
Then go to the calculate tab and tick the radio button "Custom Calculation Script", then click on the "Edit" button.
You may use a script like this:
if (event.value > 0) {
event.value = event.target.value * .15;
}
else event.value ="";
Copy link to clipboard
Copied
That code would work but it will keep calculating *.15 every time there is change in form.
Try using this as "Validation" script:
event.value = event.value*.15;
Copy link to clipboard
Copied
Thank you so much! So far in testing, this has worked the best.
Copy link to clipboard
Copied
Thank you for spotting that NesaNurani.
Copy link to clipboard
Copied
I just wanted to thank you for trying to help. While Nesa's script provided the answer, your input was greatly appreciated.
Copy link to clipboard
Copied
The last post "I just wanted to thank you for trying to help. While Nesa's script provided the answer, your input was greatly appreciated." was intended for Is_rbls. I think I posted to the wrong reply. Your help was also appreciated.
Copy link to clipboard
Copied
You're welcome, and no worries we're all here to help in one way or the other.