I created a simple page with list box and text area with conditions that all should be required.
List box are working fine, but textarea box doesn't tell that the field is required to be filled.
<!DOCTYPE html>
<html>
<head>
<title>Ratings & Reviews</title>
<body>
<form>
<span>Customer Service*</span>
<span>
<select name=customer id=aa required>
<option selected="rate" value="" disabled>rate</option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
</select>
</span>
<br><br>
<span>Value for money*</span>
<span>
<select name=money id=aa required>
<option selected="rate" value="" disabled>rate</option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
</select>
</span>
<div>
<textarea name="reviews" rows=11 cols=50 maxlength=250 required>
</textarea>
</div>
<div id=submit>
<br>
<input type=submit name=submit value=submit>
</div>
</form>
</body>
</html>
The problem is with the spaces between the tags. You are not supposed to give any spaces in html between these tags, otherwise browser will consider it as the value.
And probaly form has
novalidate
attribute. Any form-element validation attributes (likerequired
orregexp
) with form novalidate attribute will ignore.You have empty space inside text area, remove it:
try this