Validate radio button in datagrid, datalist, gridview on button

Posted on July 8, 2009. Filed under: Asp.net, Datalist, JavaScript, Repeater, gridview |

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”);
for(i=0;i<=obj.length-1;i++)
{
if(obj[i].type==”radio” && obj[i].checked==true)
{
counter++;
}
}
if(counter==0)
{ alert(’Plz Select question Answer’);
return false
}
return true;
}

</script>


Read Full Post | Make a Comment ( None so far )

Recently on Dream Asp.net...

Get Rss data using javascript

Posted on May 27, 2009. Filed under: Asp.net | Tags: |

job scheduling which work at time interval in web application in asp.net

Posted on March 24, 2009. Filed under: Asp.net | Tags: , , |

Mantains scroll position in of browser

Posted on January 14, 2009. Filed under: Asp.net |

Getting the item Index number in repeater,datalist,Datagrid,gridview -

Posted on January 14, 2009. Filed under: Asp.net | Tags: |

Color char in any srting

Posted on January 3, 2009. Filed under: Asp.net |

nesting repeater in datalist (slider menu)

Posted on January 3, 2009. Filed under: Asp.net |

TextBox with numeric input only : textbox, only, numeric, input

Posted on December 24, 2008. Filed under: JavaScript |

change theme of page dynamically

Posted on December 19, 2008. Filed under: Asp.net |

Encription of user sensitive data

Posted on December 19, 2008. Filed under: C# |

Write Meta tag in aspx page dynamically

Posted on December 19, 2008. Filed under: Asp.net |

    About

    Hi,I am Suresh Sharma(MCP) from Gorakhpur , UP, India.I have work on .net technology from 2 years. Key skills-Asp.net 2.0,3.5, Sql 2005,2000. Ajax.net 1.1,C#.net

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS
    • Subscribe in Rojo

    Meta

Liked it here?
Why not try sites on the blogroll...