Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Adding up dollar amounts from text field populated with letter and numbers

$
0
0

I have a "TotalCost"  Text Field. I am looking for it to show the costs of items in another Text Field. That text field could look like, "item1 ($500.00), item2 (65.78), item3, item4 ($.0.00)". What I am looking to do is have the "TotalCost" show the sum of all the dollar values, and adjust properly as items are added or removed. I believe a regular expression is needed to match the and I came up with /\$\d{1-4}\.\d{2}/ although I'm lost on how to implement the code for the TotalCost field for what I'm trying to do.

 

Appreciate any insight.


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>