validators messing up layout in IE before being triggered?

Discussion in 'ASP .Net' started by =?Utf-8?B?RGFiYmxlcg==?=, Apr 11, 2006.

  1. I have RequiredFieldValidators which are displacing my layout before the
    validator is used. This only happens in IE, Firefox renders the page
    correctly.

    Sample useage:
    <asp:Label ID="lblLastName" runat="server"
    CssClass="waLabel" Text="Last Name" ></asp:Label>
    <asp:TextBox ID="tbLastName" Text='<%# Bind("LastName")
    %>' ReadOnly="false" runat="server" CssClass="waTextBox" Width="180px"
    MaxLength="25"></asp:TextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
    ControlToValidate="tbLastName" ErrorMessage="Last name is required"
    SetFocusOnError="True" ValidationGroup="regForm">
    <img src="~/images/bangs.gif" title="required"
    /></asp:RequiredFieldValidator><br />

    When I comment out the Validator control everything renders as it should.

    Can anyone suggest a solution as the vertical spacing of my Label-TextBox
    combinations isn't consistent and the form looks unprofessional.

    Thanks much.
    =?Utf-8?B?RGFiYmxlcg==?=, Apr 11, 2006
    #1
    1. Advertising

  2. Turns out that if I remove the img tag in the Validator's content and use
    text to indicate the error instead the layout renders ok. Too bad, I had a
    cute exclamation point I was using to highlight the fields in error which
    worked fine in Firefox.

    "Dabbler" wrote:

    > I have RequiredFieldValidators which are displacing my layout before the
    > validator is used. This only happens in IE, Firefox renders the page
    > correctly.
    >
    > Sample useage:
    > <asp:Label ID="lblLastName" runat="server"
    > CssClass="waLabel" Text="Last Name" ></asp:Label>
    > <asp:TextBox ID="tbLastName" Text='<%# Bind("LastName")
    > %>' ReadOnly="false" runat="server" CssClass="waTextBox" Width="180px"
    > MaxLength="25"></asp:TextBox>
    > <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
    > ControlToValidate="tbLastName" ErrorMessage="Last name is required"
    > SetFocusOnError="True" ValidationGroup="regForm">
    > <img src="~/images/bangs.gif" title="required"
    > /></asp:RequiredFieldValidator><br />
    >
    > When I comment out the Validator control everything renders as it should.
    >
    > Can anyone suggest a solution as the vertical spacing of my Label-TextBox
    > combinations isn't consistent and the form looks unprofessional.
    >
    > Thanks much.
    >
    >
    =?Utf-8?B?RGFiYmxlcg==?=, Apr 11, 2006
    #2
    1. Advertising

  3. have you tried Display="Dynamic" option on the validator
    ?

    "Dabbler" <> wrote in message
    news:D...
    > Turns out that if I remove the img tag in the Validator's content and use
    > text to indicate the error instead the layout renders ok. Too bad, I had a
    > cute exclamation point I was using to highlight the fields in error which
    > worked fine in Firefox.
    >
    > "Dabbler" wrote:
    >
    >> I have RequiredFieldValidators which are displacing my layout before the
    >> validator is used. This only happens in IE, Firefox renders the page
    >> correctly.
    >>
    >> Sample useage:
    >> <asp:Label ID="lblLastName" runat="server"
    >> CssClass="waLabel" Text="Last Name" ></asp:Label>
    >> <asp:TextBox ID="tbLastName" Text='<%#
    >> Bind("LastName")
    >> %>' ReadOnly="false" runat="server" CssClass="waTextBox" Width="180px"
    >> MaxLength="25"></asp:TextBox>
    >> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
    >> ControlToValidate="tbLastName" ErrorMessage="Last name is required"
    >> SetFocusOnError="True" ValidationGroup="regForm">
    >> <img src="~/images/bangs.gif" title="required"
    >> /></asp:RequiredFieldValidator><br />
    >>
    >> When I comment out the Validator control everything renders as it should.
    >>
    >> Can anyone suggest a solution as the vertical spacing of my Label-TextBox
    >> combinations isn't consistent and the form looks unprofessional.
    >>
    >> Thanks much.
    >>
    >>
    Swanand Mokashi, Apr 11, 2006
    #3
  4. Thanks, I hadn't even know about it. I'll give it a try.


    "Swanand Mokashi" wrote:

    > have you tried Display="Dynamic" option on the validator
    > ?
    >
    > "Dabbler" <> wrote in message
    > news:D...
    > > Turns out that if I remove the img tag in the Validator's content and use
    > > text to indicate the error instead the layout renders ok. Too bad, I had a
    > > cute exclamation point I was using to highlight the fields in error which
    > > worked fine in Firefox.
    > >
    > > "Dabbler" wrote:
    > >
    > >> I have RequiredFieldValidators which are displacing my layout before the
    > >> validator is used. This only happens in IE, Firefox renders the page
    > >> correctly.
    > >>
    > >> Sample useage:
    > >> <asp:Label ID="lblLastName" runat="server"
    > >> CssClass="waLabel" Text="Last Name" ></asp:Label>
    > >> <asp:TextBox ID="tbLastName" Text='<%#
    > >> Bind("LastName")
    > >> %>' ReadOnly="false" runat="server" CssClass="waTextBox" Width="180px"
    > >> MaxLength="25"></asp:TextBox>
    > >> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
    > >> ControlToValidate="tbLastName" ErrorMessage="Last name is required"
    > >> SetFocusOnError="True" ValidationGroup="regForm">
    > >> <img src="~/images/bangs.gif" title="required"
    > >> /></asp:RequiredFieldValidator><br />
    > >>
    > >> When I comment out the Validator control everything renders as it should.
    > >>
    > >> Can anyone suggest a solution as the vertical spacing of my Label-TextBox
    > >> combinations isn't consistent and the form looks unprofessional.
    > >>
    > >> Thanks much.
    > >>
    > >>

    >
    >
    >
    =?Utf-8?B?RGFiYmxlcg==?=, Apr 12, 2006
    #4
  5. glad to help -- let us know if it works
    "Dabbler" <> wrote in message
    news:...
    >
    > Thanks, I hadn't even know about it. I'll give it a try.
    >
    >
    > "Swanand Mokashi" wrote:
    >
    >> have you tried Display="Dynamic" option on the validator
    >> ?
    >>
    >> "Dabbler" <> wrote in message
    >> news:D...
    >> > Turns out that if I remove the img tag in the Validator's content and
    >> > use
    >> > text to indicate the error instead the layout renders ok. Too bad, I
    >> > had a
    >> > cute exclamation point I was using to highlight the fields in error
    >> > which
    >> > worked fine in Firefox.
    >> >
    >> > "Dabbler" wrote:
    >> >
    >> >> I have RequiredFieldValidators which are displacing my layout before
    >> >> the
    >> >> validator is used. This only happens in IE, Firefox renders the page
    >> >> correctly.
    >> >>
    >> >> Sample useage:
    >> >> <asp:Label ID="lblLastName" runat="server"
    >> >> CssClass="waLabel" Text="Last Name" ></asp:Label>
    >> >> <asp:TextBox ID="tbLastName" Text='<%#
    >> >> Bind("LastName")
    >> >> %>' ReadOnly="false" runat="server" CssClass="waTextBox" Width="180px"
    >> >> MaxLength="25"></asp:TextBox>
    >> >> <asp:RequiredFieldValidator ID="RequiredFieldValidator2"
    >> >> runat="server"
    >> >> ControlToValidate="tbLastName" ErrorMessage="Last name is required"
    >> >> SetFocusOnError="True" ValidationGroup="regForm">
    >> >> <img src="~/images/bangs.gif" title="required"
    >> >> /></asp:RequiredFieldValidator><br />
    >> >>
    >> >> When I comment out the Validator control everything renders as it
    >> >> should.
    >> >>
    >> >> Can anyone suggest a solution as the vertical spacing of my
    >> >> Label-TextBox
    >> >> combinations isn't consistent and the form looks unprofessional.
    >> >>
    >> >> Thanks much.
    >> >>
    >> >>

    >>
    >>
    >>
    Swanand Mokashi, Apr 12, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    373
    Joerg Jooss
    Feb 9, 2006
  2. Replies:
    1
    Views:
    571
    John Timney \(MVP\)
    Jun 19, 2006
  3. thebad1
    Replies:
    9
    Views:
    385
    Patricia Shanahan
    Jan 12, 2007
  4. Microsoft Newsserver

    OnBeforeUpdate being triggered by asynchronous events.

    Microsoft Newsserver, Jun 24, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    367
  5. Graham J
    Replies:
    2
    Views:
    106
    Graham J
    Sep 20, 2003
Loading...

Share This Page