文本框onkeyup事件 [英] Textbox onkeyup event
本文介绍了文本框onkeyup事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个联系表单,我想限制用户在文本框中写内容.
我正在使用的电子邮件文本框
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.)
推荐答案
检查此项目. >
Lowar案例 [ String.toLowerCase() [
check this..
Lowar Case[^]
String.toLowerCase()[^]
function capitaliseFirstLetter(string)
{
return string.charAt(0).toUpperCase() + string.slice(1);
}
这篇关于文本框onkeyup事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文