Here is the sample code for JavaScript validation against ASP dropdownlist. Script will be:
function validateDropDown(obj){
if(document.getElementById(obj).value=='')
{
alert('please select an item value under any group name.');
return false;
}
}
In code behing, you have to attach the above JavaScript function with DropDownList control and a Button control that will submit the form data to the server
protected void Page_Load(object sender, EventArgs e)
{
DropDownList1.Attributes.Add("onchange", "javascript:return validateDropDown('" + DropDownList1.ClientID + "');");
Button1.Attributes.Add("onclick", "javascript:return validateDropDown('" + DropDownList1.ClientID + "');");
}