<script> function isValid(frm) { var firstname = frm.firstname.value; var sms = document.getElementById("idno99").value; var address1 = frm.address1.value; if ( firstname == null || firstname == "") { alert("Adınız alanı boş bırakılmış"); document.getElementById("firstname").focus(); return false; } if ( sms == null || sms == "009x-xxxxxxxxxx" || sms == "" || sms == " ") { alert("SMS kodu alanı boş bırakılmış veya 0090-5xxxxxxxxx formatında yazılmamış"); document.getElementById("customfield1").focus(); return false; } if ( address1 == null || address1 == "") { alert("Adres alanı boş bırakılmış"); document.getElementById("address1").focus(); return false; } return true; } </script> <form method="post" role="form" onsubmit="return isValid(this)"> <input type="text" name="firstname" id="firstname" value="" class="form-control" /> </form>