I have a jquery currency input and I am using this code:
$('input[name="precio"]').spinner({
min:0,
numberFormat: 'C'
});
The input works perfectly as it shows the number as a number with the $ or € sign depending on globalize.
The problem is that when I submit the form I get the text like this "5,00 €" and I would like it to be 5.00 or 500, just the number value.
Is there any way to do this? Thanks in advance.
Ok I finnaly managed to do this the way I wanted. I've just created a plugin named currencyspinner that extends spinner from JQueryUI, here is the code:
I create a hidden input with the same name and give it the value of aria-valuenow each time the spinner refreshes.
BE CAREFUL if you are trying to acess the currencyspinner after creating the currencyspinner you cannot use
$('input[name="nameoftheelement"]').currencyspinner(...);as this will be the hidden input and not the spinner itself.I Hope it helps someone!