Page 1 of 1

Force UPPERCASE in subform fields (RESOLVED)

Posted: Sat Feb 03, 2024 10:38 pm
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...

Re: Force UPPERCASE in subform fields (SOLVED)

Posted: Sun Feb 04, 2024 9:00 am
by calida82
I solved it by adding this code to the onInput event of the field

Code: Select all

$(this).val($(this).val().toUpperCase());

Re: Force UPPERCASE in subform fields (RESOLVED)

Posted: Sun Feb 04, 2024 4:45 pm
by kev1n
Yes, that's the way to go