JavaScript Form Validation
function validateForm() {
var x = document.forms["myForm"]["fname"].value;
if (x == "") {
alert("Name must be filled out");
return false;
}
}HTML Form Example
Name:
Do you think you like the “placeholder” option that puts the example in the field itself or the prompt off to the right of the field better?
placeholder
readonly