


Hello all! I'm building adaptive forms in AEM and I need assistance with a rule or script to force user entered data from a text field to upper case letters. In Designer we used this JS: xfa.event.change=xfa.event.change.toUpperCase(); Wondering how to get this same functionality into the Adaptive side of forms.
thanks!
Views
Replies
Sign in to like this content
Total Likes
@Mayank_Gandhi I got this figured out! Thank you so much for trying to help. Here is what worked:
Event: Value Commit
Code Editor: this.value=this.value.toUpperCase()
Views
Replies
Sign in to like this content
Total Likes
@nowackem XFA events are not for adaptive form. You can take 2 route:
1. you can use css:
to make a block of text have all capital letters, use text-transform: uppercase in your CSS selector. The text-transform property accepts three possible values: uppercase: Sets each word to uppercase in a text element.
2. JS:
var text = "Hello World!";
var result = text.toUpperCase();
CSS need to go in style editor or client libs and js will go in code editor. The event would be value commit,
Views
Replies
Sign in to like this content
Total Likes
@Mayank_Gandhi Thank you for your reply. I'm looking to use the JS option. I implemented the provided script but I'm not able to make it work. I do have the event set as Value Commit. Can you help me troubleshoot to figure out what I'm missing? Please let me know if you need other info from me to help me solve this. I appreciate it.
Views
Replies
Sign in to like this content
Total Likes
@nowackem send me your test form pls.
Views
Replies
Sign in to like this content
Total Likes
@Mayank_Gandhi I dont have a public site where I can publish these yet as we are not live just have a sandbox. I can send screenshots. Will that work?
Views
Replies
Sign in to like this content
Total Likes
Views
Replies
Sign in to like this content
Total Likes
@Mayank_Gandhi I got this figured out! Thank you so much for trying to help. Here is what worked:
Event: Value Commit
Code Editor: this.value=this.value.toUpperCase()
Views
Replies
Sign in to like this content
Total Likes
Of course you needed to set the value of the result back to the field.
Views
Replies
Sign in to like this content
Total Likes