<!DOCTYPE html>
<html>
<head>
<title>Form</title>
<link rel="stylesheet" href="styles.css">
<script>
//Not sure the correct syntax for the validation of the textbox, trying to allow just alpha characters. If alpha characters are not entered message should appear. Upon click of submit button user should be presented with message depending on result.
funtion validate() {
var Frmforename = document.getElementbyName("Frmforename")[0].value;
var re = (/^[A-Za-z]+$/);
if (re.test(Frmforename)) {
alert("Correct.");
}
}
else
(re.test(Frmforename)) {
alert("Incorrect.");
</script>
</head>
<body>
<div>
<form>
<form action = "donothing.html" method = "Post" name = "FrmRegister" class ="FrmForm" id = "FrmForm" onsubmit="validate()">
//Upon click of the submit button message should appear.
Forename: <input type = "text" name = "Frmforename" id = "Frmforename" placeholder = "Please enter your forename" > <br><br>
Surname: <input type = "text" name = "FrmSurname" placeholder = "Please enter your surname" > <br><br>
Gender:
Male<input type = "radio" name = "FrmGender" value = "Male">
Female<input type = "radio" name = "FrmGender" value = "Female"><br><br>
Date Of Birth: <input type = "text" name = "FrmDateOfBirth" placeholder = "Please enter your DOB" > <br><br>
Age: <input type = "text" name = "FrmAge" placeholder = "Please enter your Age" > <br><br>
Course: <select name="FrmCourse" id="Course">
<option value="Database">Database</option>
<option value="Networks">Networks</option>
<option value="Web Development">Web Development</option>
</select> <br><br>
Date: <input type = "text" name = "Date" placeholder = "Please enter the date" > <br><br>
<input type ="Submit" name ="Submit" value ="Submit">
</div>
</form>
</body>
</html>