How to
validate dropdownlist for must select an item leaving first item in asp.net
through javascript.
function Dropdown_Validation(fieldid, msgid) {
var empty =
document.getElementById(fieldid).value;
if (empty == "--Select--")
{
document.getElementById(msgid).innerHTML = "Please
Select An Item";
//document.getElementById(error_icon_star).innerHTML='<img
src="WebResource.gif" height="15px"
style="width:15px;"/>';
return false;
}
document.getElementById(msgid).innerHTML = " ";
//document.getElementById(error_icon_star).innerHTML='<b
style="color:Red">*</b>';
return true;
}
No comments:
Post a Comment