31
Views
6
Comments
Solved
Save all form data uppercase - Reactive Application
Question

Hello,

there is a way to save all my form text input in uppercase?


Thanks

Giacomo

2024-01-04 09-21-21
Venkatesaiya
Solution

Replying to Giacomo Socini's comment on 21 Nov 2023 13:54:02
Before create data , you assign the value like in below image

or you can use this like also
I hope this will helpful for you
regards,
venkatesaiya

2024-01-04 09-21-21
Venkatesaiya

Hi @Giacomo Socini ,
Use the  ToUpper() function before Create save data in DB.

regards,
Venkatesaiya

2023-05-12 11-01-41
Giacomo Socini

Hello Venkatesaiya,

thanks for your reply.


How can I use this function inside the input field?


Thanks

Giacomo 

2024-01-04 09-21-21
Venkatesaiya
Solution

Replying to Giacomo Socini's comment on 21 Nov 2023 13:54:02
Before create data , you assign the value like in below image

or you can use this like also
I hope this will helpful for you
regards,
venkatesaiya

UserImage.jpg
Rakhi Chouhan

Hi,
Check this documentation it will help you.

Thanks,
Rakhi

2023-05-12 11-01-41
Giacomo Socini

Hi Rakhi,

I have to create an assign value from each input of my form? I have a lot of field..

Thanks

Giacomo

2017-06-21 13-04-28
Mikko Nieminen

To save data in DB as uppercase, server side ToUpper() is the only way to be sure, as mentioned above. This can be done in your server-side action when saving data.

Client side options are basically all covered in here: https://www.the-art-of-web.com/html/input-field-uppercase/, but in short, you'd need a JavaScript action in each input's onblur/onkeypress/on<X> event, where you replace the contents of input field with it's uppercase equivalent.

If you only need to show the data as uppercase, you can style your form by applying CSS style/class to all input fields: { text-transform: uppercase; }. This option is for looks only, data will be saved exactly as user typed it in.

Evil UX option would be to restrict the allowed characters in your inputs using html5 pattern attribute (pattern="[A-Z]"), but that doesn't guarantee evil users would not be able to input lowercase data as a revenge to your silly decisions.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.