Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

153
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda