Form Kontrolü Javascript

<!DOCTYPE html>
<html>
<head>
<script>
function formGecisi() {
    var x = document.forms["Form1"]["kullanici_adi"].value;

    if (x == null || x == "") {
        alert("Boş Alanları Doldurunuz.");
        return false;
    }
}
</script>
</head>


<body>
<form name="Form1" action="demo_form.php" onsubmit="returnformGecisi()" method="post">
Name: <input type="text" name="kullanici_adi">
<input type="submit" value="Submit">
</form>
</body>

</html>
Name:

Hiç yorum yok:

Yorum Gönder