Form with HTML that stores the data in JavaScript variables [closed]

-1

I need to create an HTML form that at the time of pressing submit, save all the data entered in different variables, I need them to be saved in those variables to be output later by a .pdf document which is already programmed.

Maybe the question seems silly, but I'm a beginner. Thanks in advance.

    
asked by Jesus Gregorio Altuve Roa 25.07.2017 в 20:15
source

1 answer

2

You can give id to inputs and do the following:

function captutaDatos(){
var dato1 = document.getElementById('id_input').value
var dato2 = document.getElementById('id_input2').value
//...
}

and the form

<form onsubmit="capturaDatos(); return false">

</form>
    
answered by 25.07.2017 / 20:23
source