se ho un form
Codice PHP:
<form action="pagina.php" method="post" enctype="application/x-www-form-urlencoded" name="invio" id="invio">

    <
input name="nome" type="text" id="nome" />


    <
input name="cognome" type="text" id="cognome" />


    <
input name="email" type="text" id="email" />

</
form
c'è un modo per far si che una funzione mi recuperi in automatico tutti i valori delgi input field?
cioè io per listarmi tutti i campi in questo caso dovrei fare
Codice PHP:
var nome document.getElementById('nome').value;
var 
cognome document.getElementById('cognome').value;
var 
email document.getElementById('email').value;

//oppure

var nome document.invio.nome;
var 
cognome document.invio.cognome.value;
var 
email document.invio.email.value
c'è un metodo che me lo fà in automatico?