Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

jQuery: Convert Text to UpperCase or LowerCase

Nov 27, 2012
Introduction

In this 
jQuery article I will explain how to change text to uppercase or lowercase or convert text to uppercase/lowercase using jQuery in asp.net.

Description:
  
In previous articles I explained
Change the style of tooltip in jQuery, jQuery Countdown timer script example, jQuery Increase or Decrease font size of website, Redirect to another page after some time delay, jQuery slideUp slideDown toggle effects and many articles relating to JQuery and asp.net. Now I will explain how to convert text to uppercase or lowercase using jQuery in asp.net.

To convert upper or lowercase we need to write the code like as shown below

<script type="text/javascript">
$(function() {
// Convert to UpperCase
$('#txtName').keyup(function() {
this.value = this.value.toUpperCase();
});
// Convert to LowerCase
$('#txtLocation').keyup(function() {
this.value = this.value.toLowerCase();
})
})
</script>
If you want to see this with complete example check below code

Example


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery Convert Text to Lowercase or Uppercase</title>
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function() {
// Convert to UpperCase
$('#txtName').keyup(function() {
this.value = this.value.toUpperCase();
});
// Convert to LowerCase
$('#txtLocation').keyup(function() {
this.value = this.value.toLowerCase();
})
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>UpperCase Textbox:<input type="text" id="txtName" /></p>
<p>LowerCase Textbox: <input type="text" id="txtLocation" /></p>
</div>
</form>
</body>
</html>

Live Demo

To check Live demo try to enter data in below textboxes


UpperCase Textbox:
LowerCase Textbox:

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

1 comments :

Unknown said...

Hello guys..
agar hamare pass 40 textbox hain to kya hame 40 functions banane padege ???....

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.