Current location: Hot Scripts Forums » Programming Languages » ASP.NET » Validator ctrl in table cell : Strange behaviour


Validator ctrl in table cell : Strange behaviour

Reply
  #1 (permalink)  
Old 09-04-03, 10:51 AM
sunny_doncaster sunny_doncaster is offline
New Member
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Validator ctrl in table cell : Strange behaviour

I have a table with several rows, each row contains a cell with a text box and a RegularExpressionsValidator control. This table cell is just wide enough to fit the text box so the validator message always ends up directly below.

This validator control has its display mode set to 'Dynamic' so the table cell and row height expands when the entry is invalid and the message is shown.

While testing the validator, I deliberately type in some invalid text that causes the validator control to show its error message.

Of course this does not happen until the text box has lost focus.

When I click the mouse to put the cursor in the text box below the cursor actually ends up in the error message displayed by the validator control that is now shown.
Stranger still I can actually edit the text of this error message or delete it completely.
Even stranger after deleting the message I can backspace and delete the text box above !!

(Pressing return results in the cursor ending up in the text box below).

Anybody got any clues whatsoever as to why this happens and maybe how to prevent it from happening ???

Any ideas would be greatly appreciated.

Sunny D
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-04-03, 01:41 PM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
Sounds strange. Could you please post some code.
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-04-03, 03:12 PM
Stealth Stealth is offline
1337 pr0gr4mm3r
 
Join Date: Jun 2003
Location: Glasgow, Scotland
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
its posessed!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 09-05-03, 04:00 AM
sunny_doncaster sunny_doncaster is offline
New Member
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally posted by Shane
Sounds strange. Could you please post some code.
With pleasure....

The following is the asp code... this example is with a htmlinputfile control but it has the same effect as with a text box.
HTML Code:
<%@ Page language="c#" Codebehind="UploadImageTest.aspx.cs" AutoEventWireup="false" Inherits="ImageUpload.UploadImageTest" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>Upload Image(s) Text</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="frmUploadImagesTest" method="post" runat="server" encType="multipart/form-data">
			<TABLE cellSpacing="5" cols="4" width="825" align="left">
				<tr>
					<td width="20"></td>
					<td width="400">
						<asp:Label ID="lblSelectFile" Runat="server">Select file :</asp:Label>
					</td>
					<td width="330">
						<asp:Label ID="lblDescription" Runat="server">File description :</asp:Label>
					</td>
					<td width="50">
					</td>
				</tr>
				<tr align="left">
					<td width="20" valign="top" align="right" style="LEFT: 0px;POSITION: relative">
						<asp:Label ID="lblInvalid1" Runat="server" Visible="True" CssClass="Data" ForeColor="red" Text="&nbsp;"></asp:Label>
					</td>
					<td width="400" align="left" valign="top" nowrap>
						<input type="file" ID="fupUploadFile1" Runat="server" style="WIDTH : 400px" NAME="fupUploadFile">
						<asp:RegularExpressionValidator ID="regExpValidatePath1" Runat="server" ControlToValidate="fupUploadFile1" Display="Dynamic" ValidationExpression='[^*"?<>|]*' ErrorMessage="One or more illegal characters in the path" >
						</asp:RegularExpressionValidator>
					</td>
					<td width="330" align="left" valign="top">
						<asp:TextBox Runat="server" ID="txtDescription1" Width="330" CssClass="Data"></asp:TextBox>
					</td>
					<td width="50" align="center" valign="top">
						<asp:LinkButton ID="lnkViewImage1" NavigateUrl="" Target="_blank" href="" Runat="server">View</asp:LinkButton>
					</td>
				</tr>
				<tr align="left">
					<td width="20" valign="top" align="right" style="LEFT: 0px;POSITION: relative">
						<asp:Label ID="lblInvalid2" Runat="server" Visible="True" CssClass="Data" ForeColor="red" Text="&nbsp;"></asp:Label>
					</td>
					<td width="400" align="left" valign="top">
						<input type="file" ID="fupUploadFile2" Runat="server" style="WIDTH : 400px" NAME="fupUploadFile2">
						<asp:RegularExpressionValidator ID="regExpValidatePath2" Runat="server" ControlToValidate="fupUploadFile2" Display="Dynamic" ValidationExpression='[^*"?<>|]*' ErrorMessage="One or more illegal characters in the path" >
						</asp:RegularExpressionValidator>
					</td>
					<td width="330" align="left" valign="top">
						<asp:TextBox Runat="server" ID="txtDescription2" Width="330" CssClass="Data"></asp:TextBox>
					</td>
					<td width="50" align="center" valign="top">
						<asp:LinkButton ID="lnkViewImage2" NavigateUrl="" Target="_blank" href="" Runat="server">View</asp:LinkButton>
					</td>
				</tr>
				<tr>
					<td width="20">&nbsp;</td>
					<td width="400">&nbsp;</td>
					<td width="330">&nbsp;</td>
					<td width="50">&nbsp;</td>
				</tr>
				<tr>
					<td width="20">&nbsp;</td>
					<td width="400"><asp:button id="btnUploadImages" Runat="server"></asp:button></td>
					<td width="330">&nbsp;</td>
					<td width="50">&nbsp;</td>
				</tr>
				<tr>
					<td width="20">&nbsp;</td>
					<td colspan="3" align="left">
						<asp:Label style="TEXT-ALIGN: left" ID="lblMaxUploadSize" Enabled="False" Runat="server" Width="100%"
							Text="" Font-Size="8"></asp:Label>
					</td>
				</tr>
				<tr>
					<td></td>
					<td colspan="3" align="left">
						<asp:Label style="TEXT-ALIGN: left" ID="lblMessage" Runat="server" Width="100%" Text=""></asp:Label>
					</td>
				</tr>
			</TABLE>
		</form>
	</body>
</HTML>

Last edited by Nico; 07-30-08 at 10:28 AM. Reason: Wrappers.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 09-05-03, 09:50 AM
Shane Shane is offline
Coding Addict
 
Join Date: Jun 2003
Location: Maryland, US
Posts: 268
Thanks: 0
Thanked 0 Times in 0 Posts
hm.. your code runs normal for me. What browser are you using to test this?

This is an extremely weird case. I haven't heard anything like it. Has someone else tried executing it on your development machine from their computer?
__________________
Shane Bauer
Microsoft Certified Professional (MCP) - ASP.NET
ASP/ASP.net, C#, VB/VB.NET, PHP, Perl, SQL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 07-30-08, 09:55 AM
gepstein gepstein is offline
New Member
 
Join Date: Jul 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Have the same problem on IE

I have the same problem also, only on IE, Firefox works fine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 07-31-08, 10:43 AM
dobybest dobybest is offline
New Member
 
Join Date: Jul 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
same thing over here...

Does anyone have any ideeas? Can somebody point at least to a good thread some place else?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
moving data from table to table ..please help! geneane ASP 2 09-22-03 08:02 PM


All times are GMT -5. The time now is 01:35 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.