• Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Precios
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

82
Vistas
JQuery: dynamically retrieve value from autoNumeric

I have a group of textbox on which I configured an autoNumeric (this plugin: https://github.com/autoNumeric/autoNumeric ):

$("input[name$='something']").autoNumeric('init', {aSep: '.', aDec: ',', aSign: ' €', vMax: '99999999999.9999'});

When I post my form I want to reformat the values on the textbox:

function parseBeforeSubmit() {
    $("input[name$='something']").val(function(){
                                                    var myText = $(this)[0];
                                                    return myText.autoNumeric('get');
                                                });
}

obviously I cant get it working, what I'm seeing is that myText has a property called jQuery36000058939066319538821 which contains autoNumeric, but it seems strange that I can't dynamically access the autoNumeric component and also it seems this autoNumeric component doesn't contains the unformatted numeric value.

Sure there's something I'm missing or maybe I used the wrong approach?

9 months 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 empleo Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.