Multiple choice technology web technology

Consider an HTML form with a checkbox and a text field. When data is entered and the return key is pressed, the data seems to be lost before the user can click on the button that calls the processing function. How do you correct this?

  1. Add a TYPE=HIDDEN INPUT to the form

  2. Trap the return keypress and return (null

  3. Add 'return false' to onsubmit="..." in the FORM tag

  4. Instruct the user not to press the Return key.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The issue is that pressing Return in a text field within a form submits the form prematurely, before the user can click the processing button. The correct solution is to add 'return false' to the onsubmit handler in the FORM tag, which prevents the default form submission behavior. Option A (hidden input) doesn't address the issue. Option B (trapping return key) is incomplete. Option D (user instruction) is not a technical solution.