Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Clear Displayed Value

Avatar

Former Community Member
This should be extremely simple, but I cannot figure it out:



I have some "if" statements attached to the change event of a numerical box that checks the value of other drop down selections and the value just entered into the num box. This works properly and an alert goes up if the value is less than the minimum amout.



My issue is that the displayed value still shows the entered value. I want to clear the displayed value so the user must re-enter a valid number. I just cannot figure out how to clear the displayed value.



Thanks.
2 Replies

Avatar

Former Community Member
Hi Mark,



var numBox = xfa.resolveNode("numericBox");

numBox .rawValue = null;

xfa.host.setFocus("numericBox");



Use this script to reset the value and to set focus on the field.



Regards,



Chris Fourie

www.intelliform.co.za

Avatar

Former Community Member
Thanks Chris. Once I added your script to the exit event it worked perfectly. It still did not work on the change event, but it turns out I needed it to be on the exit event anyway.



Thanks again.



Mark