Try executing $('#name').focus() before alert.
And probably replace #name == '' with adSoyad == ''.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
when user if user leaves blank any step cursor to where error is taken
For Example
var name = $('#name').val();
if (name == '') {
$('#name').css('border-color', 'red');
alert('Please write your first and last name')
return false;
} else {
$('#name').css('border-color', 'black');
}
(ASP.NET MVC WEB)
Try executing $('#name').focus() before alert.
And probably replace #name == '' with adSoyad == ''.
No problem for textbox and drowboxlist. But I can't send to checkbox?
var cinsiyetValue = $('#cinsiyetValue').val();
if (cinsiyetValue == '') {
$('#cinsiyetValue').css('border-color', 'red');
$('#cinsiyetValue').focus()
alert('Lütfen Cinsiyet Seçiniz')
return false;
} else {
$('#cinsiyetValue').css('border-color', 'black');
}
where's my wrong sir ?