I created a survey page. Below is what I’ve done:
Seems okay, the alignment is okay.
I’ve used a table to do those. Now my problem is when there are error messages, the alignment will get ruin.
Is it possible to make the asterisk of the validator to be on the right side of the radio button list? You can see that the radio button list of Yes and No are not aligned to the questions. Am I wrong on doing the validation on radio button list? How can I fix the alignment?
Part of my code:
<code> <ASP:TableCell Style="padding-right:20px; padding-bottom:40px; white-space: nowrap; font-size: 15px;" >
<ASP:RadioButtonList ID="rblQ2YesNo" runat="server" RepeatDirection="Horizontal" CssClass="rblSpace" AutoPostBack="true" >
<asp:ListItem Value=1 Text="[Yes]"/>
<asp:ListItem Value=0 Text="[No]"/>
</ASP:RadioButtonList>
<ASP:RequiredFieldValidator runat="server" ID="rfrblQ2YesNo"
ControlToValidate="rblQ2YesNo"
EnableClientScript="true"
ValidationGroup="vgErrorDetails" />
</code>
<code> <ASP:TableCell Style="padding-right:20px; padding-bottom:40px; white-space: nowrap; font-size: 15px;" >
<ASP:RadioButtonList ID="rblQ2YesNo" runat="server" RepeatDirection="Horizontal" CssClass="rblSpace" AutoPostBack="true" >
<asp:ListItem Value=1 Text="[Yes]"/>
<asp:ListItem Value=0 Text="[No]"/>
</ASP:RadioButtonList>
<ASP:RequiredFieldValidator runat="server" ID="rfrblQ2YesNo"
ControlToValidate="rblQ2YesNo"
EnableClientScript="true"
ValidationGroup="vgErrorDetails" />
</code>
<ASP:TableCell Style="padding-right:20px; padding-bottom:40px; white-space: nowrap; font-size: 15px;" >
<ASP:RadioButtonList ID="rblQ2YesNo" runat="server" RepeatDirection="Horizontal" CssClass="rblSpace" AutoPostBack="true" >
<asp:ListItem Value=1 Text="[Yes]"/>
<asp:ListItem Value=0 Text="[No]"/>
</ASP:RadioButtonList>
<ASP:RequiredFieldValidator runat="server" ID="rfrblQ2YesNo"
ControlToValidate="rblQ2YesNo"
EnableClientScript="true"
ValidationGroup="vgErrorDetails" />