Solved

How to capitalize the content of a an ASP textbox without posting

Posted on 2008-06-18
5
610 Views
Last Modified: 2013-11-26
Hello,

I have a web application where call center reps enter information about the caller. They want the app to capitalize the first and last name after entering them. I made the text box post back and in the textChanged event I called this function:

txtFName.Text = StrConv(txtFName.Text, VbStrConv.ProperCase)

Works great. The problem is that users did not like the fact that the page posts everytime they exit the control. Is there a way to do the same on the client side without posting?
0
Comment
Question by:htabbach
  • 4
5 Comments
 
LVL 10

Expert Comment

by:Dxpert
ID: 21815404
I think that the easier way out here, would be to use, CSS:  text-transform: capitalize;
Not sure it will work on all browsers. But It works on FireFox and IE 7

You can test it adding this to an html file.
<input type="text" name="txt" size="35" style="text-transform: capitalize;">
0
 

Author Comment

by:htabbach
ID: 21815747
That would work but when I replaced my ASP textbox with an Input textbox and I declared the control in my VB.NET it fails and tells me that object is not set.
0
 
LVL 10

Expert Comment

by:Dxpert
ID: 21815870
<asp:TextBox ID=txtId runat=server Text=ID style=text-transform: capitalize; Width=40px></asp:TextBox>

You can do it with Asp:textbox - it will render as input type="text" ;-)
0
 
LVL 10

Accepted Solution

by:
Dxpert earned 500 total points
ID: 21815881
Added quotes:
<asp:TextBox ID=txtId runat=server Text=ID style="text-transform: capitalize;"></asp:TextBox>
0
 
LVL 10

Expert Comment

by:Dxpert
ID: 21816670
Thanks! Glad I could help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now