I want to change the error message border color on text box
here is the code:
function ValidateFrom() {
if (document.getElementById("<%=txtCategoryName.ClientID %>").value.trim() == "") {
document.getElementById("<%=dvMessage.ClientID %>").innerHTML = "Please enter Category.";
document.getElementById("<%=txtCategoryName.ClientID %>").focus();
// document.getElmentById(val.controltovalidate).style.border = '3px solid red';
return false;
}
by default in form-control it will takes blue..i want while changes on error message show red border..
Midhun TpRank #388 · 6.5K reputationPosted Aug 18, 2016, 1:14 AM EDT
Santhakumar MunuswamyRank #128 · 17.3K reputationPosted Aug 18, 2016, 1:00 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 18, 2016, 2:28 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 18, 2016, 1:24 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 18, 2016, 1:42 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 18, 2016, 1:59 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 18, 2016, 2:05 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 18, 2016, 3:10 AM EDT
Midhun T P
Super..Thank you..Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 18, 2016, 9:49 PM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 18, 2016, 10:01 PM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 18, 2016, 10:13 PM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 18, 2016, 10:23 PM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 18, 2016, 11:04 PM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 19, 2016, 12:00 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 19, 2016, 2:47 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 19, 2016, 3:26 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 19, 2016, 3:32 AM EDT
if (document.getElementById("").value.trim() == "") { document.getElementById("").innerHTML = "Please enter Category."; document.getElementById("").focus(); document.getElementById("").classList.add("ErrorControl"); // document.getElementById("").style.outline = '1px solid red'; // document.getElmentById("").style.border = '3px solid red'; return false; } if (document.getElementById("").value.trim() == "") { document.getElementById("").innerHTML = "Please enter Category Description."; document.getElementById("").focus(); document.getElementById("").classList.add("ErrorControl"); // document.getElementById("").style.outline = '1px solid red'; return false; } } function checkfunction(val) { if (val != "") { document.getElementById("").classList.remove("ErrorControl"); // document.getElementById("").style.display = 'none'; document.getElementById("").classList.remove("ErrorControl"); // document.getElementById("").style.display = 'none'; } } script>div class="field"> div id="dvMessage" runat="server" style="color: Red" > div> Category Name *em> label> asp:TextBox ID="txtCategoryName" runat="server" CssClass="form-01-control" onkeyup="checkfunction(this.value)" placeholder="Enter Category Name" >asp:TextBox> div> div id="dvMsg" runat="server" style="color: Red"> div> Category Description *em>label> asp:TextBox ID="txtCategoryDescription" runat="server" CssClass="form-01-control" onkeyup="checkfunction(this.value)" placeholder="Enter Category Description">asp:TextBox> div> Parent Category label> asp:DropDownList ID="ddlParentCategory" runat="server" Width="250px" class="form-01-control"> asp:DropDownList> div> Category Imagelabel> asp:FileUpload ID="fuImage" runat="server" /> asp:Image ID="imgCategory" Width="100" Height="100" runat="server" /> div> div>Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 19, 2016, 3:33 AM EDT