I used serialize() jQuery function and it will catch all value by name of the selected form, like the code bellow.
$('#serialize').click(function(){
var ser = $('#form1').serialize();
alert(ser);
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<form id="form1">
<input type="text" name="text1">
<input type="text" name="text2">
</form>
<button id="serialize">Serialize</button>
Result
text1=&text2=
Is there a way to delete the text1 just after it serialize ?
The Result I expect
text2=