form submission handling and JS