Here is the javascript validation code:
function ValidateFrom() {
if (document.getElementById("<%=txtCategoryName.ClientID %>").value.trim() == "") {
document.getElementById("<%=dvMessage.ClientID %>").innerHTML = "Please enter Category.";
document.getElementById("<%=txtCategoryName.ClientID %>").focus();
document.getElementById("<%=txtCategoryName.ClientID %>").classList.add("ErrorControl");
// document.getElementById("<%=txtCategoryName.ClientID %>").style.outline = '1px solid red';
// document.getElmentById("<%=txtCategoryName.ClientID %>").style.border = '3px solid red';
return false;
}
if (document.getElementById("<%=txtCategoryDescription.ClientID %>").value.trim() == "") {
document.getElementById("<%=dvMsg.ClientID %>").innerHTML = "Please enter Category Description.";
document.getElementById("<%=txtCategoryDescription.ClientID %>").focus();
document.getElementById("<%=txtCategoryDescription.ClientID %>").classList.add("ErrorControl");
// document.getElementById("<%=txtCategoryDescription.ClientID %>").style.outline = '1px solid red';
return false;
}
}
function checkfunction(val) {
if (val != "") {
document.getElementById("<%=txtCategoryName.ClientID %>").classList.remove("ErrorControl");
// document.getElementById("<%=dvMessage.ClientID %>").style.display = 'none';
document.getElementById("<%=txtCategoryDescription.ClientID %>").classList.remove("ErrorControl");
// document.getElementById("<%=dvMsg.ClientID %>").style.display = 'none';
}
}
Here is the text box:
Category Name *
Category Description *
Parent Category
Category Image
The problem is that validation not working properly... The ERROR MESSAGE having problem..
Midhun TpRank #388 · 6.5K reputationPosted Aug 19, 2016, 3:51 AM EDT
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Aug 19, 2016, 2:26 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 19, 2016, 2:31 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 19, 2016, 3:30 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 19, 2016, 3:34 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 19, 2016, 3:42 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 19, 2016, 3:49 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 19, 2016, 4:31 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 19, 2016, 5:50 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 19, 2016, 9:41 PM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 19, 2016, 9:54 PM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 20, 2016, 1:49 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 20, 2016, 1:53 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 20, 2016, 2:06 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 20, 2016, 2:10 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Aug 20, 2016, 2:23 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 20, 2016, 2:26 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts