Click here to Skip to main content
14,978,764 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a contact form in which i want to restrict the user to write in a textbox.
for email textbox i am using
onkeyup="this.value=this.value.toLowerCase()"

as user type it automatically converts characters to lower case.
for all uppercase we have
onkeyup="this.value=this.value.toUpperCase()"


similarly i want for capitalize(first letter of each word is capital) and initial(first letter of each line is capital.)
Posted
Updated 7-Jul-14 7:18am
v4
Comments
   
What have you tried?
Raj Negi 7-Jul-14 14:35pm
   
i want for capitalize(first letter of each word is capital) and initial(first letter of each line is capital.)
Is there any onkeyup events for these two.?

1 solution

check this..

Lowar Case[^]


String.toLowerCase()[^]



C#
function capitaliseFirstLetter(string)
{
    return string.charAt(0).toUpperCase() + string.slice(1);
}
   
v3
Comments
Raj Negi 7-Jul-14 14:36pm
   
for lower and upper case i have solution but i want solution for capitalize(first letter of each word is capital) and initial(first letter of each line is capital.) Is there any onkeyup event available for these two?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900