?
Solved

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

Posted on 2008-06-18
5
Medium Priority
?
615 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
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 this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 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