473,586 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to convert first letter to uppercase

karthickkuchanur
156 New Member
Expand|Select|Wrap|Line Numbers
  1. if((document.forms[0].employeeId.value == 0) && (document.forms[0].applicantId.value == 0)) 
  2.             {
  3.                 alert("Please Select the  "+document.forms[0].type.value+" Code or Name");
  4.                 return false;
  5.             }
i want to make the first letter into upper case in the document.forms[0].type.value

thank u
karthick
Feb 9 '08 #1
2 9651
gits
5,390 Recognized Expert Moderator Expert
hi ...

try the following:

Expand|Select|Wrap|Line Numbers
  1. var s = document.forms[0].type.value;
  2.  
  3. s = s.match(/(^.)(.+)/);
  4.  
  5. s = s[1].toUpperCase() + s[2];
kind regards

ps: or just use:

Expand|Select|Wrap|Line Numbers
  1. s = s.replace(/^./, s.match(/^./)[0].toUpperCase());
Feb 9 '08 #2
karthickkuchanur
156 New Member
hi ...

try the following:

Expand|Select|Wrap|Line Numbers
  1. var s = document.forms[0].type.value;
  2.  
  3. s = s.match(/(^.)(.+)/);
  4.  
  5. s = s[1].toUpperCase() + s[2];
kind regards

ps: or just use:

Expand|Select|Wrap|Line Numbers
  1. s = s.replace(/^./, s.match(/^./)[0].toUpperCase());
Thank u for ur reply
Feb 12 '08 #3

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

Similar topics

23
25908
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner, so I assume it's simplest to convert to lower/upper first. Possibly all strings will be from the latin-1 character set, so I could convert to...
6
2088
by: Bart Nessux | last post by:
number = random.sample(range(count), 1) This makes 'number' into a one entry list (I don't know why as 'count' is an integer). Is there an easy way to convert 'number' back to an int? TIA
30
21768
by: rh0dium | last post by:
Hi All, While I know there is a zillion ways to do this.. What is the most efficient ( in terms of lines of code ) do simply do this. a=1, b=2, c=3 ... z=26 Now if we really want some bonus points.. a=1, b=2, c=3 ... z=26 aa=27 ab=28 etc..
4
9073
by: dave | last post by:
Hi How to make first letter of word in upper case? i.e. hello should return Hello Is there any inbuilt function?? Thanx dave
1
4102
by: Dwight Shubert | last post by:
Hi all, This is my first try using Access. I understand how to format a text field for uppercase and lowercase, but how do you capitalize only the first letter of each word? tia Dwight
23
9492
by: comp.lang.tcl | last post by:
I have a TCL proc that needs to convert what might be a list into a string to read consider this: ]; # OUTPUTS Hello World which is fine for PHP ]; # OUTPUT {{-Hello}} World, which PHP will print literally as {{-Hello}} World, instead of
2
34063
by: setabery | last post by:
When entering a value to a field, is there a way to make only the first letter upper case without using the Shift Key? For example, entering a name.
14
43782
by: fniles | last post by:
In VB.NET 2005 can I check if a letter in a string is upper case or lower case ? For example: I have the following 2 lines: NQ,Z2003,11/11/2003,1416.5,1420,1402,1411.5 NQ,z2003,11/10/2003,223801,260154 NQ,H2004,11/11/2003,1416.5,1422.5,1406.5,1415 NQ,h2004,11/10/2003,56,1191 Notice the 1st line has uppercase Z (Z2003) and the 2nd line...
1
3534
by: Germaris | last post by:
Hi there! Nowadays trend is to write everything in lowercase. Last Names, First Names, City Names, etc... Maybe the use of computers is one of the reasons to such bad typing. In a form, there's a lot of Input Fields to fill-in... Is there a way in AS to make the first letter typed in an uppercase one? I thank you in advance for the help...
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8215
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.