How to display text from the beginning in Textbox after moving cursor out [Resolved]

Posted by Somu475 under C# on 2/18/2013 | Points: 10 | Views : 2009 | Status : [Member] | Replies : 2
Hi All,

I'm having number of Textboxes in one screen. Each Textboxes have fixed Width.
On entering some characters in any Textbox, the starting characters starts hiding when characters crosses the width of Textbox.
(i.e Textbox width is less but the characters entered are more, then some starting characters are hided).

When I move the cursor somewhere outside of that Textbox, the characters from last will be displaying in that Textbox and some starting characters will not be displayed.

I want to display characters from beginning, please someone help me out.



Posted by: Somu475 on: 2/19/2013 [Member] Starter | Points: 25


Hi Blessyjees,
Thanks for ur reply...

I found the way to solve my problem.

I used onfocusout event and some logic in javascript as below and it solved my problem.

In aspx page:
<asp:TextBox ID="TxtInstituteName" runat="server" MaxLength="50" Text='<%# Bind("Institute") %>'

Width="80px" onfocusout="TextChanged(this);" ></asp:TextBox>

Javascript code:
function TextChanged(txt) {

var input = txt.value;
txt.value = "";
txt.value = input;


Somu475, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Blessyjees on: 2/19/2013 [Member] Bronze | Points: 25


how did you set the width of the text box. i am not able to find any issue while trying your scenario.

Blessy Baby
Digitalmesh Softech pvt Ltd

Somu475, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response