Showing posts with label onkeyup. Show all posts
Showing posts with label onkeyup. Show all posts

Tuesday, 4 November 2014

How to lowercase of input field in onkeyup event?

Script Method:
<input type="text" id="ele" onkeyup="this.value=this.value.toLowerCase()" >
CSS Method:
Add style "text-transform:uppercase"
<input type="text" id="ele" style='text-transform:lowercase' >

Monday, 3 November 2014

How to uppercase of input field in onkeyup event?

Script Method:
<input type="text" id="ele" onkeyup="this.value=this.value.toUpperCase()" >
CSS Method:
Add style "text-transform:uppercase"
<input type="text" id="ele" style='text-transform:uppercase' >

Thursday, 9 October 2014

Enter Floating Number only

Input field onkeyup check floating values only to allow
onkeyup="if (!isFinite(this.value)) this.value = this.value.replace(/(\s+)?.$/,'')"