471,354 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

serverside RequiredValidator not working FireFox

TJS
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>
Nov 19 '05 #1
3 2004
TJS
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" <no****@here.com> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
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>

Nov 19 '05 #2
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"TJS" <no****@here.com> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
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" <no****@here.com> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
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>


Nov 19 '05 #3
TJS
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" <PL****@Blum.info> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"TJS" <no****@here.com> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
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" <no****@here.com> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
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>



Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by SStory | last post: by
1 post views Thread by Elie Medeiros via .NET 247 | last post: by
7 posts views Thread by tshad | last post: by
6 posts views Thread by Mark Olbert | last post: by
2 posts views Thread by Niraj Sikotara | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.