serverside RequiredValidator not working FireFox

Discussion in 'ASP .Net' started by TJS, May 20, 2005.

  1. TJS

    TJS Guest

    I am finding that the serverside requiredvalidator doesn't fire in the
    firefox browser, and user request proceeds through to my updateProfile
    method. Validation is working correctly in the IE browser.

    Anyone seen this problem or have any ideas why this might be occurring ??

    (I have web.config browsercaps updated from http://slingfive.com/ )

    code:
    =========
    Sub Submit_Click(Sender As Object, e As EventArgs)
    If Page.IsValid then Call updateProfile()
    End Sub


    html:
    =========

    <asp:Button id="Btn_Submit" onClick="Submit_Click" Runat="Server"
    Text="Update"></asp:Button>
    TJS, May 20, 2005
    #1
    1. Advertising

  2. TJS

    TJS Guest

    Additional info:
    ===============

    In my page, the form is being pre-filled from a database so the user can
    review the existing values in their profile.

    when using the firefox browser, I have discovered that when the form has
    been given a value such as

    "phone.text = [value retrieved from db]"

    that the retrieved value is what becomes tested by the validator .

    My problem is , if the user changes a value, the validator is not testing
    the new entry, but is testing what was originally retrieved from the
    database.

    Has anyone else seen this problem using firefox ?? is there away to
    resolve it ??

    (The same page works fine in IE, and the new entries are tested)




    "TJS" <> wrote in message
    news:...
    >I am finding that the serverside requiredvalidator doesn't fire in the
    >firefox browser, and user request proceeds through to my updateProfile
    >method. Validation is working correctly in the IE browser.
    >
    > Anyone seen this problem or have any ideas why this might be occurring ??
    >
    > (I have web.config browsercaps updated from http://slingfive.com/ )
    >
    > code:
    > =========
    > Sub Submit_Click(Sender As Object, e As EventArgs)
    > If Page.IsValid then Call updateProfile()
    > End Sub
    >
    >
    > html:
    > =========
    >
    > <asp:Button id="Btn_Submit" onClick="Submit_Click" Runat="Server"
    > Text="Update"></asp:Button>
    >
    TJS, May 21, 2005
    #2
    1. Advertising

  3. TJS

    Peter Blum Guest

    From your description, I would focus on two things:
    1. The code that sets the Text property from the database is running before
    you validate. (Makes sense, right?)
    The TextBox gets its Text property by looking at
    Request.Forms[TextBox.UniqueID] after it gets added to the Page's controls
    tree. This is automatic and no feature built into .net will overwrite it.
    Only the user's code is allowed to modify the Text property after its added
    to the page.
    Generally its wise to get the Text property in the post back event handlers
    (after Page_Load) because that's when you know its setup. (Post back event
    handlers were intended to handle the data sent by the browser with the
    assurance the controls have been properly prepared.)
    2. What if the TextBox.UniqueID has changed? It will not retrieve the value
    passed back from the server. In this case, the ViewState which stored the
    original value (from the database) will be in the Text property. The
    ViewState is always assigned prior to applying the value from Request.Forms.
    How does the UniqueID get changed? Its built upon the ID of the TextBox and
    IDs of all naming containers that are its ancestors. For example, if your
    textbox is in UserControl "MyUC", UniqueID is "MyUC_:TextBox1". So if any of
    the IDs involved are differently, it will cause this problem.

    --- Peter Blum
    www.PeterBlum.com
    Email:
    Creator of "Professional Validation And More" at
    http://www.peterblum.com/vam/home.aspx

    "TJS" <> wrote in message
    news:...
    > Additional info:
    > ===============
    >
    > In my page, the form is being pre-filled from a database so the user can
    > review the existing values in their profile.
    >
    > when using the firefox browser, I have discovered that when the form has
    > been given a value such as
    >
    > "phone.text = [value retrieved from db]"
    >
    > that the retrieved value is what becomes tested by the validator .
    >
    > My problem is , if the user changes a value, the validator is not testing
    > the new entry, but is testing what was originally retrieved from the
    > database.
    >
    > Has anyone else seen this problem using firefox ?? is there away to
    > resolve it ??
    >
    > (The same page works fine in IE, and the new entries are tested)
    >
    >
    >
    >
    > "TJS" <> wrote in message
    > news:...
    >>I am finding that the serverside requiredvalidator doesn't fire in the
    >>firefox browser, and user request proceeds through to my updateProfile
    >>method. Validation is working correctly in the IE browser.
    >>
    >> Anyone seen this problem or have any ideas why this might be occurring ??
    >>
    >> (I have web.config browsercaps updated from http://slingfive.com/ )
    >>
    >> code:
    >> =========
    >> Sub Submit_Click(Sender As Object, e As EventArgs)
    >> If Page.IsValid then Call updateProfile()
    >> End Sub
    >>
    >>
    >> html:
    >> =========
    >>
    >> <asp:Button id="Btn_Submit" onClick="Submit_Click" Runat="Server"
    >> Text="Update"></asp:Button>
    >>

    >
    >
    Peter Blum, May 21, 2005
    #3
  4. TJS

    TJS Guest

    thanks for replying

    I'm not after the textbox value stored in the viewstate, or anywhere else,
    I'm trying to validate the user entry in the form. The validation should be
    looking at the current form value not at the hidden fields.

    I don't believe the id issue is the source of the trouble. The validation
    works in IE, but not in firefox, so the problem appears to be .net with
    firefox browser and prefilled forms.



    "Peter Blum" <> wrote in message
    news:%...
    > From your description, I would focus on two things:
    > 1. The code that sets the Text property from the database is running
    > before you validate. (Makes sense, right?)
    > The TextBox gets its Text property by looking at
    > Request.Forms[TextBox.UniqueID] after it gets added to the Page's controls
    > tree. This is automatic and no feature built into .net will overwrite it.
    > Only the user's code is allowed to modify the Text property after its
    > added to the page.
    > Generally its wise to get the Text property in the post back event
    > handlers (after Page_Load) because that's when you know its setup. (Post
    > back event handlers were intended to handle the data sent by the browser
    > with the assurance the controls have been properly prepared.)
    > 2. What if the TextBox.UniqueID has changed? It will not retrieve the
    > value passed back from the server. In this case, the ViewState which
    > stored the original value (from the database) will be in the Text
    > property. The ViewState is always assigned prior to applying the value
    > from Request.Forms.
    > How does the UniqueID get changed? Its built upon the ID of the TextBox
    > and IDs of all naming containers that are its ancestors. For example, if
    > your textbox is in UserControl "MyUC", UniqueID is "MyUC_:TextBox1". So if
    > any of the IDs involved are differently, it will cause this problem.
    >
    > --- Peter Blum
    > www.PeterBlum.com
    > Email:
    > Creator of "Professional Validation And More" at
    > http://www.peterblum.com/vam/home.aspx
    >
    > "TJS" <> wrote in message
    > news:...
    >> Additional info:
    >> ===============
    >>
    >> In my page, the form is being pre-filled from a database so the user can
    >> review the existing values in their profile.
    >>
    >> when using the firefox browser, I have discovered that when the form has
    >> been given a value such as
    >>
    >> "phone.text = [value retrieved from db]"
    >>
    >> that the retrieved value is what becomes tested by the validator .
    >>
    >> My problem is , if the user changes a value, the validator is not
    >> testing the new entry, but is testing what was originally retrieved from
    >> the database.
    >>
    >> Has anyone else seen this problem using firefox ?? is there away to
    >> resolve it ??
    >>
    >> (The same page works fine in IE, and the new entries are tested)
    >>
    >>
    >>
    >>
    >> "TJS" <> wrote in message
    >> news:...
    >>>I am finding that the serverside requiredvalidator doesn't fire in the
    >>>firefox browser, and user request proceeds through to my updateProfile
    >>>method. Validation is working correctly in the IE browser.
    >>>
    >>> Anyone seen this problem or have any ideas why this might be occurring
    >>> ??
    >>>
    >>> (I have web.config browsercaps updated from http://slingfive.com/ )
    >>>
    >>> code:
    >>> =========
    >>> Sub Submit_Click(Sender As Object, e As EventArgs)
    >>> If Page.IsValid then Call updateProfile()
    >>> End Sub
    >>>
    >>>
    >>> html:
    >>> =========
    >>>
    >>> <asp:Button id="Btn_Submit" onClick="Submit_Click" Runat="Server"
    >>> Text="Update"></asp:Button>
    >>>

    >>
    >>

    >
    >
    TJS, May 21, 2005
    #4
    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. SStory

    requiredvalidator for checkbox

    SStory, Jul 30, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    1,337
    SStory
    Jul 30, 2003
  2. Elie Medeiros via .NET 247

    Custom Validator not working without RequiredValidator

    Elie Medeiros via .NET 247, May 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    8,652
    William F. Robertson, Jr.
    May 18, 2005
  3. tshad

    RequiredValidator not working

    tshad, May 20, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    2,003
    Peter Blum
    May 21, 2005
  4. Niraj Sikotara
    Replies:
    2
    Views:
    535
    Niraj Sikotara
    Sep 21, 2006
  5. Pete Fitz
    Replies:
    0
    Views:
    554
    Pete Fitz
    Sep 30, 2008
Loading...

Share This Page