Add this to your form tag's attributes:

onsubmit="form_onsubmit"

Then add a function called 'form_onsubmit' that loops through the input tags and passes their values to the CleanSQL function.