What's wrong with my code, seems like required
attribute is not working, even If first option, that has "" value
, is selected you can push submit and move forward. Here is the code:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<title>Choose</title>
</head>
<body>
<form method="post" action="page.php">
<select name="blabla" required>
<option value="">Choose</option>
<?php
foreach($blazz as $blaz){
?>
<option value="<?php echo $blaz ?>"><?php echo $blaz ?></option>
<?php
}
?>
</select>
<button type='submit' name="tvt" value="ok" class="button">Submit</button>
</form>
</body>
</html>