Hi,
On some pages, my radgrid has textboxes in template columns and in some other pages, we have checkboxes in template columns. Common requirement is upon submit (submit button) is clicked, I need to make sure that atleast 1 textbox or 1 checkbox is checked. So, I am planning to write a common code to be used for all the pages.
I am using this link javascript code to begin with:
For eg:
http://www.telerik.com/community/forums/aspnet-ajax/grid/checkbox-template-column-in-radgrid.aspx
so something like this:
var inputElement = cell.getelementbytagname('INPUT')
if (inputElement.type) == "CheckBox"{}
elseif (inputElement.type == "text"
Summary, I need to find the type of control and then code.
Thanks,
Prathiba
On some pages, my radgrid has textboxes in template columns and in some other pages, we have checkboxes in template columns. Common requirement is upon submit (submit button) is clicked, I need to make sure that atleast 1 textbox or 1 checkbox is checked. So, I am planning to write a common code to be used for all the pages.
I am using this link javascript code to begin with:
For eg:
http://www.telerik.com/community/forums/aspnet-ajax/grid/checkbox-template-column-in-radgrid.aspx
<script type="text/javascript"> function ClientClick(gridName, templateColumnName) { var count = 0; var grid = $find(gridName);
var MasterTable = grid.get_masterTableView(); for (var i = 0; i < MasterTable.get_dataItems().length; i++) { var gridItemElement = MasterTable.get_dataItems()[i].findElement("CheckBox1");
// Instead of hard codeing, I need to find what type of control is in template column
// and based on that write code if (gridItemElement.checked) { count++; break; } } if (count == 0) { alert("Please check atleast one !"); return false; } }</script>so something like this:
var inputElement = cell.getelementbytagname('INPUT')
if (inputElement.type) == "CheckBox"{}
elseif (inputElement.type == "text"
Summary, I need to find the type of control and then code.
Thanks,
Prathiba