new line character in the validation

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.

0
avmood
4/2/2008 3:38:40 PM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 6 followers.

💬 4 Replies
👁️‍🗨️ 908 Views

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

0
ShaunRigby
4/2/2008 4:04:37 PM

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>

*

</asp:RequiredFieldValidator>&nbsp;

0
avmood
4/2/2008 4:07:21 PM

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.

See http://www.blooberry.com/indexdot/css/properties/classify/display.htm


--- Peter Blum
Creator of Peter's Data Entry Suite (formerly Professional Validation And More and Peter's Date Package) and Peter's Polling Package
www.PeterBlum.com
0
PLBlum
4/2/2008 4:12:35 PM

Hi, Set RadioButtonList.RepeatLayout = Flow works out perfectly for me. Thanks again.

0
avmood
4/2/2008 4:30:14 PM
Reply: