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

0

81
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?

8 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos