Convert Case Of Text Box

[Total: 0    Average: 0/5]

This shows how to convert a form text component’s value to either Uppercase, or Lowercase.

Body Code:

<form name=exf1>
<BR><input type=text name=n1 value="StuffGoesHere">
<BR><input type=text name=n2 value="MoreStuff">
<BR><input type=button onclick="Up()" value="UpCase">
<BR><input type=button onclick="Down()" value="LowerCase">
</form>
<script type=text/javascript>
function Up() {
  document.exf1.n1.value = document.exf1.n1.value.toUpperCase();
  document.exf1.n2.value = document.exf1.n2.value.toUpperCase()
}
function Down() {
  document.exf1.n1.value = document.exf1.n1.value.toLowerCase();
  document.exf1.n2.value = document.exf1.n2.value.toLowerCase()
}
</script>

Times Viewed: 1

Leave a Reply

Your email address will not be published. Required fields are marked *