EDN Admin
Well-known member
Hi all
I am having a radio buton has three lists. If i Select radio button other than TestOK. It should fire Textbox required field validation. but the text box having default leading spaces so the required field validation is not firing as it is taking textbox space as one caharcter.
Please help to solve this <asp:TableCell>
<asp:RadioButtonList ID="radio1" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" >
<asp:ListItem Value="0" Text="TestOK </asp:ListItem>
<asp:ListItem Value="1" Text="TestDenied </asp:ListItem>
<asp:ListItem Value="2" Text="testRecycle </asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="Reqselection" CssClass="red" runat="server" ControlToValidate="radio1" ValidationGroup="val1" ErrorMessage="Selection Required" Display="Dynamic" EnableClientScript="true" ></asp:RequiredFieldValidator>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow CssClass="left
<asp:TableCell VerticalAlign="Top Text Comments:</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtComment1" runat="server" Rows="5" Columns="50" TextMode="MultiLine" ToolTip="Enter a comment" EnableViewState="true </asp:TextBox>
<asp:RequiredFieldValidator ID="reqcomment" CssClass="red" runat="server" ControlToValidate="txtComment1" ValidationGroup="val1" ErrorMessage=" comments is required" Display="Dynamic" EnableClientScript="true </asp:RequiredFieldValidator>
</asp:TableCell>
View the full article
I am having a radio buton has three lists. If i Select radio button other than TestOK. It should fire Textbox required field validation. but the text box having default leading spaces so the required field validation is not firing as it is taking textbox space as one caharcter.
Please help to solve this <asp:TableCell>
<asp:RadioButtonList ID="radio1" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" >
<asp:ListItem Value="0" Text="TestOK </asp:ListItem>
<asp:ListItem Value="1" Text="TestDenied </asp:ListItem>
<asp:ListItem Value="2" Text="testRecycle </asp:ListItem>
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="Reqselection" CssClass="red" runat="server" ControlToValidate="radio1" ValidationGroup="val1" ErrorMessage="Selection Required" Display="Dynamic" EnableClientScript="true" ></asp:RequiredFieldValidator>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow CssClass="left
<asp:TableCell VerticalAlign="Top Text Comments:</asp:TableCell>
<asp:TableCell>
<asp:TextBox ID="txtComment1" runat="server" Rows="5" Columns="50" TextMode="MultiLine" ToolTip="Enter a comment" EnableViewState="true </asp:TextBox>
<asp:RequiredFieldValidator ID="reqcomment" CssClass="red" runat="server" ControlToValidate="txtComment1" ValidationGroup="val1" ErrorMessage=" comments is required" Display="Dynamic" EnableClientScript="true </asp:RequiredFieldValidator>
</asp:TableCell>
View the full article