JSFiddle - React, Tailwind, and code Playground
by BilisimOgretmeni
HTML
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>www.bilisimogretmeni.com</title>
<script type="text/javascript">
function kontrol(form){
var hata = [];
if ( !SelectKontrol(form.secim) ) {
hata[hata.length] = "Lütfen seçim yapın";
}
if (hata.length > 0) {
hatakontrol(hata);
return false;
}
//www.bilsimogretmeni.com
return true;
}
function SelectKontrol(select){
return (select.selectedIndex > 0);
}
function hatakontrol(hata){
var msg = "Hataları düzeltip tekrar deneyin...\n";
var numError;
for (var i = 0; i<hata.length; i++) {
numError = i + 1;
msg += "\n" + numError + ". " + hata[i];
}//www.bilsimogretmeni.com
alert(msg);
}
</script>
</head>
<body>
<h1>Kahvenizi Nasıl içersiniz</h1>
<form method="post" action="islem.html"
onsubmit="return kontrol(this);">
<strong>Seçiminiz...:</strong>
<select name="secim">
<option value="0" selected></option>
<option value="Şekerli">Şekerli</option>
<option value="Orta Şekerli">Orta Şekerli</option>
<option value="Şekersiz">Şekersiz</option>
</select>
<br><br>
<input type="submit" value="Gönder">
</form>
</body>
</html>