The ability to interact with, and obtain information from web site visitors, is a central theme behind the Java Script language.
No Java Script book would be complete therefore, without exploring how to handle Graphical User Interface Components (GUI) objects such as buttons, text input fields, checkboxes, radio boxes and selections, together with the Form object which brings them all together. It acts a container for all of the GUI objects that make up a form.
The little script outputs the value of the $name, $email, $website, and $comment variables.
A submit button is created using the processing before outputting the input to form.
For now, we are just checking whether the input is empty or not.
Then, we also need to show which radio button that was checked.
Such code can now do no harm and is safe to be displayed on a page or inside an e-mail. if quotes are escaped with a slash \ let's remove that.