So i have a textbox in cshtml that formats value to currency. I am writing from memory, it works:
Html.TextBoxFor(m => m.pricevalue, { @class="required numeric" Value= String.Format("{0:C}", m.pricevalue)})
So for validation purposes I need to strip the dollar sign and commas, but i cannot simply do:
$(#container + '_pricevalue').val(stripped value)
Because it will change the textbox value.
My real problem however is validation of the multiple textboxes, I need to strip the value for each but don't know how dynamically:
e = $(#container + '_pricevalue');
e.each(function () { $(this).rules('add', { max: maxpricevalue, messages: { max: "Must be less than max price" } }); });
Is there a way I can strip e.val() for rules validation, or even better have the textbox display currency format but actual value of the textbox to be the stripped value? Thanks