...

View Full Version : Need Toltip to display contents of the Textbox



pmcs
01-18-2012, 03:36 PM
Hi Folks,

Have a C# application. On one of the .aspx page, I have a simple textbox:

<asp:TableCell ColumnSpan="4">
<asp:TextBox ID="txtBox1" runat="server" Width="210px" MaxLength="100" TextMode="MultiLine" /></asp:TableCell>

The Textbox display about half of its 100 character capacity to the user. I need the Tooltip to display the entire contents when hovered. Since the user can enter any length of text and hover the tooltip at any time, I figure Javascript in the codebehind page (.aspx.cs ) would be the solution. I know absolutley nothing about JAVA script ! Can anyone help ?

Thank You in advance for your help !

xelawho
01-18-2012, 04:10 PM
I don't know what a textbox is in asp but it if is like a textarea in html, you can do this:



<body>
<textarea onmouseover='title=this.value'>
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"
</textarea>
</body>

pmcs
01-18-2012, 04:28 PM
THANK YOU !!!!

That is exactly what I was looking for !

<asp:TableCell ColumnSpan="4">
<CustomControls:TextArea onmouseover='title=this.value' ID="txtNMElaboration" runat="server" Width="210px" MaxLength="100" TextMode="MultiLine"
OnChange="setDirtyFlag()" /></asp:TableCell>

And the best part is that I don't have to modify the code behind page.

xelawho
01-18-2012, 04:49 PM
:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum