Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validator Bug??? 1

Status
Not open for further replies.

vbkris

Programmer
Jan 20, 2003
5,994
IN
hi guys,

there seems to be a strange problem with validator controls. :(

steps to make it behave strangely (Code given below):
1. Enter a value in the first text box.
2. Move focus to second text box.
3. Delete the text in the first text box.
4. Use the MOUSE to give focus to the second text box.

Behavior that i got:
The validator control becomes editable! plus you can delete all content along with the textbox to validate!!!!!

What kind of behavior is this? do we have any MSDN support articles for the same???

Code for the testing:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>TestValidator</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="[URL unfurl="true"]http://schemas.microsoft.com/intellisense/ie5">[/URL]
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<TABLE id="Table1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 8px" cellSpacing="1"
				cellPadding="1" width="700" border="1">
				<TR>
					<TD><STRONG>Mandatory Validation</STRONG></TD>
					<TD></TD>
				</TR>
				<TR>
					<TD>Empty Label</TD>
					<TD>
						<asp:TextBox id="TextBox1" EmptyLabel="Enter the value!!" runat="server"></asp:TextBox>
						<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ErrorMessage="<br>RequiredFieldValidator"
							ControlToValidate="TextBox1" Display="Dynamic"></asp:RequiredFieldValidator></TD>
				</TR>
				<TR>
					<TD>Empty Label</TD>
					<TD>
						<asp:TextBox id="TextBox2" EmptyLabel="Enter the value!!" runat="server"></asp:TextBox>
</TD>
				</TR>
			</TABLE>
		</form>
	</body>
</HTML>

Known is handfull, Unknown is worldfull
 
I don't see that behavior in any browser (IE6, IE7, Firefox, Opera).


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
i have an IE6.0
am testing this in 1.1 (dont see how that will affect the code).

but it is happening continuoulsy for me. you used mouse to give focus to the textfield right???

Known is handfull, Unknown is worldfull
 
I used version 2.0 of the framework and yes, I used the mouse to give focus to the second TextBox.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
hmmm,

unfortunately i am unable to give you a demo, cause its happening consecutively for me :(

will try to set this up in .NET 2.0 also...

Known is handfull, Unknown is worldfull
 
I don't know why this happens, but your problem is in this line, remove the "<br>" tag:
Code:
ErrorMessage="[b]<br>[/b]RequiredFieldValidator"

Also, this code is not valid, but not causing the problem:
Code:
EmptyLabel="Enter the value!!"

Jim
 
oops,

dude, I am testing out something with our controls, EmptyLabel was placed because of that (just a dummy attribute).

so you ARE able to recieve this error right (i want the BR in place so that error comes in the next line! this also happens when a row is set inbetween for the validator)???

Known is handfull, Unknown is worldfull
 
guys,

kindly reply to this post, i want to raise this issue with microsoft (or has this already been raised? can i find where this can be found?)


or even better do you guys know any websites where such code is taken up and tested and then forwarded to the right authority???

Known is handfull, Unknown is worldfull
 
You can go to to register with MS and provide feedback to them. However, have you thought that this may not be an ASP.NET bug and could be an issue with your browser?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
>>However, have you thought that this may not be an ASP.NET bug and could be an issue with your browser

yup, thats exactly my thought but unfortunately i am unable to get it through to a couple of guys in my organisation, they want proof that this is a browser issue (in the form of an article by microsoft or some other reliable resource or some kind of proof).

thats exaclty whta i am looking for...

Known is handfull, Unknown is worldfull
 
vbkris,
I am getting the same issue you have using IE6 with your code. The problem I found is the <br> tag. Once I removed it, it worked correctly.

Jim
 
yup,

i agree jim, but i have a constraint in changing the same (the error messages are supposed to be displayed below the respective controls)...

Known is handfull, Unknown is worldfull
 
You'll need to encode the tags then. Use &lt; and &gt; respectively.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
ca8msm

thanx to you got the info i wanted from teh connect site.

here's the link for u guys.

it IS a browser issue!

>>You'll need to encode the tags then. Use &lt; and &gt; respectively.

i dont want to dispaly the <BR> but want to have a breaklike which was causing the problem...

Known is handfull, Unknown is worldfull
 
i dont want to dispaly the <BR> but want to have a break
That's what my suggestion will do...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
>>That's what my suggestion will do...

even if it does, it wouldnt solve the problem as it is a browser issue...

Known is handfull, Unknown is worldfull
 
No, it won't solve the ASP.NET issue but it will allow you to put a line break in you validator control which is what you wanted to do.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
>>No, it won't solve the ASP.NET issue but it will allow you to put a line break in you validator control which is what you wanted to do.


the normal <br> itself seems to be working fine for that, it does not require me to encode them...

Known is handfull, Unknown is worldfull
 
Strange, as jbenson001 said:
The problem I found is the <br> tag. Once I removed it, it worked correctly.
Maybe you aren't experiencing the same issue as he did.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
>>The problem I found is the <br> tag. Once I removed it, it worked correctly.

i think he was speaking about the error being something like this:
ErrorMessage="RequiredFieldValidator"

rather than
ErrorMessage="&lt;br&gt;RequiredFieldValidator"

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top