Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda