Step 3: Add a Function to Validate Form