Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Force UPPERCASE in subform fields (RESOLVED)

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
calida82
Posts: 58
Joined: Mon Sep 09, 2019 8:20 am

Force UPPERCASE in subform fields (RESOLVED)

Unread post by calida82 »

Hello, how can I force the uppercase in the subform fields?
In edit form i use this

Code: Select all

function forceInputUppercase(e)
  {
    var start = e.target.selectionStart;
    var end = e.target.selectionEnd;
    e.target.value = e.target.value.toUpperCase();
    e.target.setSelectionRange(start, end);
  }


document.getElementById("field_id").addEventListener("keyup", forceInputUppercase, false);
and i was hoping that it wuold also work in the subform but it doesn't...
calida82
Posts: 58
Joined: Mon Sep 09, 2019 8:20 am

Re: Force UPPERCASE in subform fields (SOLVED)

Unread post by calida82 »

I solved it by adding this code to the onInput event of the field

Code: Select all

$(this).val($(this).val().toUpperCase());
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Force UPPERCASE in subform fields (RESOLVED)

Unread post by kev1n »

Yes, that's the way to go
Post Reply