27 Nov '13

Anupa Manipal

A professional Software Developer in VB.NET - SQL Server and learner of PHP. Expertise in implementation of various projects including designing, development, coding and implementation of software applications.

0 Shares

Convert first letter to uppercase on Input box

Convert first letter to uppercase on Input box

<html>
<head>
<title>Convert first letter to uppercase on Input box</title>
<script type=”text/javascript”>
function capitalize(textboxid, str) {
// string with alteast one character
if (str && str.length >= 1)
{
var firstChar = str.charAt(0);
var remainingStr = str.slice(1);
str = firstChar.toUpperCase() + remainingStr;
}
document.getElementById(textboxid).value = str;
}
</script>
<body>
<form name=”myform” method=”post”>
<strong>Capitalize :</strong>
<input type=”text” id=”mytextbox” onkeyup=”javascript:capitalize(this.id, this.value);”>
</form>
</body>
</html>

About Anupa Manipal

A professional Software Developer in VB.NET - SQL Server and learner of PHP. Expertise in implementation of various projects including designing, development, coding and implementation of software applications.

Related Posts

Leave a Reply