Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
Jquery Validate Currency

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!