Total members 11890 |It is currently Thu Apr 25, 2024 1:51 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Radio Button list ASP

i have a table and it's rows containing radio buttonlists.i want to validate that radio buttons items wether atleast one is checked or not.if atlest one item is not checked in that case if i click submit button the the valuse should not submit.below one is my table.pls tel me how to validate radio buttons using javas script.
Code:
<table style="width: 100%; padding-bottom: 10px;" cellpadding="0" cellspacing="0"
        border="0" summary="0" id="Radiotable" runat="server">
        <tr>
            <td style="width: 10px">
            </td>
            <td width="3%">
            </td>
            <td>
                <asp:Label ID="lblError" runat="server" Font-Names="segoe UI" Font-Size="12px" ForeColor="Red"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
                1.
            </td>
            <td>
                <asp:Label ID="lblQuestion1" runat="server" Font-Names="segoe UI" Font-Size="12px"
                    Text="Did the driver report on time to the Pick up point (+ - 5 Minutes)?"></asp:Label>&nbsp;<sup
                        style="color: Red">*</sup>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
            </td>
            <td>
                <asp:RadioButtonList ID="rdlQues1" runat="server" Font-Names="segoe UI" Font-Size="12px">
                    <asp:ListItem Value="Yes">Yes</asp:ListItem>
                    <asp:ListItem Value="No">No</asp:ListItem>
                </asp:RadioButtonList>
                <asp:RequiredFieldValidator ID="rfvQues1" runat="server" ControlToValidate="rdlQues1"
                    ErrorMessage="*"></asp:RequiredFieldValidator>               
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
                2.
            </td>
            <td>
                <asp:Label ID="lblQuestion2" runat="server" Font-Names="segoe UI" Font-Size="12px"
                    Text="Did you encounter traffic jam on your route?"></asp:Label>&nbsp;<sup style="color: Red">*</sup>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
            </td>
            <td>
                <asp:RadioButtonList ID="rdlQues2" runat="server" Font-Names="segoe UI" Font-Size="12px">
                    <asp:ListItem Value="Yes">Yes</asp:ListItem>
                    <asp:ListItem Value="No">No</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
                3.
            </td>
            <td>
                <asp:Label ID="lblQuestion3" runat="server" Font-Names="segoe UI" Font-Size="12px"
                    Text="Did the driver over speed?"></asp:Label>&nbsp;<sup style="color: Red">*</sup>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
            </td>
            <td>
                <asp:RadioButtonList ID="rdlQues3" runat="server" Font-Names="segoe UI" Font-Size="12px">
                    <asp:ListItem Value="Yes">Yes</asp:ListItem>
                    <asp:ListItem Value="No">No</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
                4.
            </td>
            <td>
                <asp:Label ID="lblQuestion4" runat="server" Font-Names="segoe UI" Font-Size="12px"
                    Text="Did he pick any of Non MindTree Mind on route?"></asp:Label>&nbsp;<sup style="color: Red">*</sup>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
            </td>
            <td>
                <asp:RadioButtonList ID="rdlQues4" runat="server" Font-Names="segoe UI" Font-Size="12px">
                    <asp:ListItem Value="Yes">Yes</asp:ListItem>
                    <asp:ListItem Value="No">No</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
                5.
            </td>
            <td>
                <asp:Label ID="lblQuestion5" runat="server" Font-Names="segoe UI" Font-Size="12px"
                    Text="Did the driver demonstrate rude behavior?"></asp:Label>&nbsp;<sup style="color: Red">*</sup>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
            </td>
            <td>
                <asp:RadioButtonList ID="rdlQues5" runat="server" Font-Names="segoe UI" Font-Size="12px">
                    <asp:ListItem Value="Yes">Yes</asp:ListItem>
                    <asp:ListItem Value="No">No</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
                6.
            </td>
            <td>
                <asp:Label ID="lblQuestion6" runat="server" Font-Names="segoe UI" Font-Size="12px"
                    Text="Was the driver under the influence of Alcohol?"></asp:Label>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
            </td>
            <td>
                <asp:RadioButtonList ID="rdlQues6" runat="server" Font-Names="segoe UI" Font-Size="12px">
                    <asp:ListItem Value="Yes">Yes</asp:ListItem>
                    <asp:ListItem Value="No">No</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
                7.
            </td>
            <td>
                <asp:Label ID="lblQuestion7" runat="server" Font-Names="segoe UI" Font-Size="12px"
                    Text="Did he follow the traffic rules?"></asp:Label>&nbsp;<sup style="color: Red">*</sup>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
            </td>
            <td>
                <asp:RadioButtonList ID="rdlQues7" runat="server" Font-Names="segoe UI" Font-Size="12px">
                    <asp:ListItem Value="Yes">Yes</asp:ListItem>
                    <asp:ListItem Value="No">No</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
                8.
            </td>
            <td>
                <asp:Label ID="lblQuestion8" runat="server" Font-Names="segoe UI" Font-Size="12px"
                    Text="Was Vehicle Clean?"></asp:Label>&nbsp;<sup style="color: Red">*</sup>
            </td>
        </tr>
        <tr>
            <td style="width: 10px">
            </td>
            <td align="center" width="3%">
            </td>
            <td>
                <asp:RadioButtonList ID="rdlQues8" runat="server" Font-Names="segoe UI" Font-Size="12px">
                    <asp:ListItem Value="Yes">Yes</asp:ListItem>
                    <asp:ListItem Value="No">No</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
    </table>


Thanks in advanced.




Author:
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Radio Button list validation ASP
 redirect page based on user selection radio button     -  
 Convert link and button to custom button with good style     -  
 JSF Radio Buttons Form     -  
 form-Radio-buttons-checkBoxs-actions-HTML-Tags     -  
 DNS Validation     -  
 XML validation against DTD     -  
 validation using JavaScript     -  
 Validation using Ajax     -  
 US Zip Code Validation     -  
 validation on number     -  



Topic Tags

ASP Validation
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com