How to confirm the input data before form is submitted?