Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-06-18
5
Medium Priority
?
619 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

783 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