Javascript - Dropdownlist validation



Dropdownlist selection required validation

function chkReq()
{
//if the dropdown selection is not done for madatory field
if(document.getElementById('<%= ddlCountry.ClientID %>').selectedIndex==0) 
{ 
alert('Select Country'); 
document.getElementById('<%= ddlCountry.ClientID %>').focus(); 
return false; 
} 
}

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.