B
bbawa1
have to validate my web page using java script. I have one dropdown
list also . I need a javascript to validate weather any item in
dropdownlist is selected or not. e.g ddlDrop is my dropdownlist.
To validate other controls I am using following
function validate()
{
if (document.getElementById("<%=txtUserName.ClientID%>").value=="")
{
alert("Please Pprovide UserName");
document.getElementById("<%=txtUserName.ClientID%>").focus();
return false;
}
if (document.getElementById("<%=txtPassword.ClientID%>").value=="")
{
alert("Please provide Password");
document.getElementById("<%=txtPassword.ClientID%>").focus();
return false;
}
list also . I need a javascript to validate weather any item in
dropdownlist is selected or not. e.g ddlDrop is my dropdownlist.
To validate other controls I am using following
function validate()
{
if (document.getElementById("<%=txtUserName.ClientID%>").value=="")
{
alert("Please Pprovide UserName");
document.getElementById("<%=txtUserName.ClientID%>").focus();
return false;
}
if (document.getElementById("<%=txtPassword.ClientID%>").value=="")
{
alert("Please provide Password");
document.getElementById("<%=txtPassword.ClientID%>").focus();
return false;
}