Sometimes its mandatory to get smaller case or uppercase user input from users. For example usually we don’t type email address in capital letters (even if we do, it’s not a crime).
Let’s assume we have a text box as below
Now using jQuery I’m gonna make sure that user will never enter CAPITAL letters in the input text. Following code will do the magic.
$('#contactEmail').keyup(function() { var tempEmail = $('#contactEmail').val().toLowerCase(); $('#contactEmail').val(tempEmail); });
I hope the code itself is self explanatory.
Subscribe to our mailing list
Subscribe to our mailing list and receive a free udpates
Leave a Reply