Reputation:
Im using inputmask
with jquery. And it is working well to me but when I submit my form, input's value is sending me string
like 15,000$ but my model field is integer
. I want to be it simple integer
number.
<form method="post">
<input type="text" data-mask="rcurrency" data-sign="$">
<button type="submit">Submit</button>
How can I do that with?
Upvotes: 1
Views: 758
Reputation: 1068
You can convert it to a integer.
var number = '15,000$';
parseInt(number.replace(/,|\$/g, ''));
Upvotes: 1