function mycheck1() { var txt1 = document.getElementById("<%=txt1.clientid%>"); if (txt1.value == "") { // alert("It is Empty"); txt1.style.background = "#FFF000"; } }
asp:TextBox runat='server' ID='txt1'></asp:TextBox> <asp:CustomValidator runat="server" ID='cv1' ControlToValidate='txt1' ClientValidationFunction='mycheck1' ValidateEmptyText='true' ></asp:CustomValidator> <asp:Button runat='server' ID='btn1' Text='submit' />
var v = document.getElementById("<%=TextBox1.ClientID%>"); v.style.backgroundColor = "red";
var txt1 = document.getElementById('txt1');
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)