Text to case...
Hello devs! I am looking for a function that convert text to uppercase (or title case) in
TextInput
or TextArea
, you know any implementation to do it?
I usually do it with javascript but I can't find a way to inject JS into the component.6 Replies
Do you want to do it on submit, or "live" in the form when the blur out of the input?
Interesting question. I would like it to be live. π
You could try something like ...
Working but not as expected. π¦
How "not expected"?
https://stackoverflow.com/a/45067218
I found this answer, check the behavior with Hugh Messenger's solution.
Stack Overflow
Change Input to Upper Case
JS:
<script type="text/css">
$(function() {
$('#upper').keyup(function() {
this.value = this.value.toUpperCase();
});
});
</script>
HTML
<div id="search">
...