upper case in javascript

Posted on 2006-05-17
Last Modified: 2008-02-07
In ASP.NET 2.0 I have a textbox in a formview.
I want that when the user type something it will be changed to upper letters as he leave the field.
1. how do I do it in javascript ?
2. I wrote it in the event textchanged in the code behind but only when another button that make a postback
is pushed it happens.
Question by:ANAT2403
    1 Comment
    LVL 23

    Accepted Solution

    Hi ANAT2403,

    You can add a clientside onblur event to the textbox.
    e.g. from codebehind page load, something like this:
    MyTextBox.attributes.add("onblur","this.value = this.value.toUpperCase();")

    This "onblur" event will occur clientside.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    760 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

    8 Experts available now in Live!

    Get 1:1 Help Now