how do I get the selected values

0

I have 3 types of forms, each with several inputs

$("#formulario1, #formulario2, #formulario3 ").submit(function(e){
            e.preventDefault();
            var arreglo=[];
            $this.each(function () {
                arreglo.push($(this).val());
            });

but how do I get the inputs of the form I want to send?

    
asked by hubman 03.09.2018 в 07:35
source

1 answer

1

You can use JQuery to validate the form

var arreglo=new Array();
$("#formulario1, #formulario2, #formulario3 ").submit(function(e){
e.preventDefault();

if($(this).attr("id")=="formulario1"){
    $(this).find("input").each(function(){
        arreglo.push($(this).val());
    });
}else if(){
...
}
...

Greetings:)

    
answered by 03.09.2018 / 07:39
source