javascript - How do I force lowercase on an input field? -


i have input field client wants lowercase only. output generates input lowercase.

this have , isn't working.

<script> function tolowercase(email) {     strinput.value=strinput.value.tolowercase(); } </script> 

use oninput:

var input = document.getelementsbytagname("input")[0] // input element    input.oninput = function() {    input.value = input.value.tolowercase()  }
<input type="text" />


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -