Text input to be all uppercase

is there an ionic class that can convert all text input to uppercase and the value get stored is also uppercase?
Thanks

<label class="item item-input">
        <span class="input-label">Item Code</span>
        <input ng-model="new_item.id" type="text"></label>

Does this help: https://docs.angularjs.org/api/ng/filter/uppercase ?

This only give the view Uppercase, when the data is saved, it was saved in lowercase or the case that you are typing with

Here’s a handy javascript function: .toUpperCase();

var myString = “hello”;
myString.toUpperCase();

myString will now return “HELLO”. It’s the safest and best way to ensure that no matter what happens in the text box, that it’s always being sent or used as uppercase. So you’ll want to add that in the function that handles the data for saving or posting.

Edit:

Just remember that when doing software development, you can NEVER trust the user input. You can change it to uppercase to give them help or make the process easier but you should be validating it on the front and back end. This ensures that no one will be able to post anything with lowercase letters.

2 Likes

Thanks , this make sense,

1 Like