Wednesday, July 8, 2009

Validate radio button in datagrid, datalist, gridview on button

Here  'questionlist' is the id of Datalist or datagrid or Gridview or repeater

u call this function on button events

<button onclick="return isconfirm()" />

<script language=javascript>
function isconfirm()

var counter=0;

var obj=document.getElementById("<%=questionlist.ClientID%>").getElementsByTagName("input");
if(obj[i].type=="radio" && obj[i].checked==true)
{ alert('Plz Select question Answer');
return false
return true;

AJAX, asp,, and sql server security, IntemIndex, C#, Css, DataBinder.Eval, DataKeyNames, Datalist, Datapager, DataSet, DataTable, DropDownList, FindControl, gridview, JavaScript, jquery, Listview, Paging, Regex, RegularExpression, Repeater, Server side validation, Sql Server, timer, timercallback, Validation, XML, xmlnode, XPath