Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
validation on client side on gridview textbox and dropdown
manish kedar
Dec 12 2017 2:37 AM
199
Hello Sir,
I have a girdview, in that i have textbox and dropdownlist.
I want to validate that control on client side with checkbox if checkbox is checked then check the textbox is empty and dropdownlist also.
I done that validation but whenever checkbox is checked and textbox not empty then also alert msg is showing..
Please help me.
the code is :--
on button click....
function Validate() {
var chkBoxList = document.getElementById('<%=gv_Toppers.ClientID %>');
var chkBoxCount = chkBoxList.getElementsByTagName("input");
for (var i = 0; i <chkBoxCount.length; i++) {
if (chkBoxCount[i].checked) {
var txtMarks = document.getElementById('txtMarks');
var ddlRank = document.getElementById('ddlRank');
if(txtMarks=="" || txtMarks== null)
{
alert("Please Enter Student Marks!!!");
return false;
}
if (ddlRank.value == "0" || ddlRank.value == "Select Rank") {
alert("Please Select Student Rank!!!");
return false;
}
}
}
}
Reply
Upload Source Code
Select only zip and rar file.
Post
Reset
Answers (
2
)
How to get Request.Form["amount"] data get in master page
how to InsertId column should be clickble in asp.net