Hi, I have a radiobuttonlist repeatdirection horizontally, and I have a requirefieldvalitor against this field with *. However, when the user miss the field and a red * is outputed, but it goes to the next line. I want them to be on the same line. How can I do that? Thanks.
post some code?
There may not be enough space on the line for it to go there so it automatically goes to the next line
Actually there are still a lot of space on the line. here's the code.
<asp:RadioButtonList ID="GenderSelect" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="GenderSelect_SelectedIndexChanged" AutoPostBack="true"><asp:Listitem Value="F" Text="Female" /> <asp:Listitem Value="M" Text="Male" /> </asp:RadioButtonList>
<asp:RequiredFieldValidator id="RequiredFieldValidator1" ControlToValidate="GenderSelect" Display="Static" ErrorMessage="You must select a gender" InitialValue="" runat=server>
By default, the RadioButtonList creates a <table>. The <table> tag is a block-style tag, forcing any HTML after it to the next line.
You have two options:
Set RadioButtonList.RepeatLayout = Flow
Set RadioButtonList.Style.Add("display", "inline") programmatically. This may vary based on the browser as some like block-inline or table-inline.
--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
Hi, Set RadioButtonList.RepeatLayout = Flow works out perfectly for me. Thanks again.