JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div id="container">
<div id="left">
<!--Logo -->
<img src="../images/ABC_2013.png" alt="Test logo" height="202" width="190" />
<!--Links -->
<ul id="navlist">
<li id="active"><a href="index.htm">HOME</a>
</li>
<li><a href="about.htm">ABOUT US</a>
</li>
<li><a href="gallery.htm">GALLERY</a>
</li>
<li><a href="services.htm">SERVICES</a>
</li>
<li><a href="contact.htm">CONTACT</a>
</li>
</ul>
</div>
<div id="mid">
<h1> Contact</h1>
<p>We love hearing from our customers! Use the form below to get in touch about any questions or comments you might have – we’ll reply as quickly as we possibly can. If you would like to talk to us about your eye's or anything you need, please use the form below:</p>
<form>
<fieldset id="pi">
<legend>Personal Information</legend>
<p>
<label for="first_name">First name:</label>
<input type="text" name="first name" id="first_name" autofocus required>
<br>
</p>
<p>
<label for="last_name">Last Name:</label>
<input type="text" name="Last Name" id="last_name" required>
<br>
</p>
<p>
<label for="email">Email:</label>
<input type="email" name="email" id="email" required>
<br>
</p>
<p>
<label for="phone">Phone:</label>
<input type="text" name="phone" id="phone">
<br>
</p>
...
JavaScript
<!-- Begin
<
script type = "text/javascript" > function _validate()
var emVal, fnVal, lnVal, phoneVal, addressVal;
var _fname = document.getElementById('first_name').value;
var _lname = document.getElementById('last_name').value;
var _email = document.getElementById('email').value;
var _phone = document.getElementById('phone').value;
var _address = document.getElementById('address').value;
var _lblError = document.getElementById('lblError');
if (_email != "" || _email != null) {
var b = _emailValidator(_email);
if (b == false) {
_lblError.innerHTML = "Invalid Email";
emVal = false;
} else {
fnVal = true;
if (_fname == "" || _fname == null) {
_lblError.innerHTML = "Enter First Name";
fnVal = false;
} else {
lnVal = true;
if (_lname == "" || _lname == null) {
lblError.innerHTML = "Enter Last Name";
lnVal = false;
} else {
phoneVal = true;
if (_phone == "" || _phone == null) {
lblError.innerHTML = "Enter Phone";
phoneVal = false;
} else {
addressVal = true;
if (_address == "" || _address == null) {
_lblError.innerHTML = "Enter your Address";
addressVal = false;
} else {
addressVal = true;
if (emVal == true && fnVal == true && lnVal == true && phoneVal == true && addressVal == true) {
postIt();
}
}
}
}
}
}
} else {
_lblError.innerHTML = "Enter Email ID";
emVal = false;
...