Pass values from the current form to a function before submitting the form

Pass values from the current form to a function before submitting the form

Hello,
 
I want to pass the values from the current form BEFORE it is submitted, i.e. it doesn't have an ID yet. Is there a way, apart from manually passing each field value (or creating lists or maps, etc.)?
 
Thanks,
 
Fidel Martín