473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Case Conversion

How to convert the case on clicking a button dynamically?
If a button is clicked first time then it should display the cahracters in CAPITAL in a text box and clicking the same button second time should display in text as small character and vice versa.
Please provide me sample coding if you have.

THANKS in advance
Jul 1 '08 #1
7 1428
acoder
16,027 Expert Mod 8TB
Use the string's toUpperCase/toLowerCase methods.
Jul 1 '08 #2
Thanks for your reply. But the requirement is clicking a button should change the case in vise versa manner like Caps Lock in key board.(Required the same function)
Jul 1 '08 #3
acoder
16,027 Expert Mod 8TB
Show your code so far so I can suggest changes/additions.
Jul 1 '08 #4
hsriat
1,654 Expert 1GB
Thanks for your reply. But the requirement is clicking a button should change the case in vise versa manner like Caps Lock in key board.(Required the same function)
You need to check the keyCode on the keypress event. If the keycode is on an alphabet, convert it to the required case's code (depending upon the status of the button).
Jul 1 '08 #5
Thanks. But how do i know how many times i pressed the capslock button.For first time pressing it should return all values in text as CAPITAL and second time being small and 3rd time being CAPITAL and so on. Can you please provide sample codings?
[HTML]<input name="textarea" type="text" />
<input type="button" name="button1" onclick="type('a')" />
<input type="button" name="button1" onclick="type('b')" />
<input type="button" name="Capsbutton" ___? />
[/HTML]****
Expand|Select|Wrap|Line Numbers
  1. function type(x){
  2. var  object =document.getElementById("textarea");
  3. var app = object.value;
  4. object.value=app+x;
  5. }
  6.  
Please provide for caps lock function.
Jul 2 '08 #6
hsriat
1,654 Expert 1GB
Save a flag variable, which gets toggled onclick of the button.
true = CAPITALS
false = smalls
Jul 2 '08 #7
acoder
16,027 Expert Mod 8TB
bytesbytes, you've been told before about using code tags. They make the code much easier to read. See How to Ask a Question. I don't want to have to ask you again.

Moderator.
Jul 2 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Tumurbaatar S. | last post by:
Hi, I'm running MySQL 3.23.55 on WinXP and have some problem using non latin charset. I've added these 2 lines under group of my.ini: character-sets-dir = c:/mysql/share/charsets/...
5
by: Nils O. Selåsdal | last post by:
Is there some quick C++ way I can do something similar to string::find , but case insensitive ?
22
by: DJ | last post by:
Can someone tell me the library call that converts strings to lower case or retrns a new string that is lower case of the original, thanks im using <string> David
11
by: jguilford | last post by:
I have created a SQL Stored Procedure that uses a Case statement to determine the Order By. For one of the Case statements I am trying to turn a Char field into Datetime in for the Order By,...
0
by: n33470 | last post by:
We have a web site that is being converted from the 1.1 format into 2.0. I've noticed that after the web project has been converted, the first time that the solution is opened in VS, all of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.