Adding placeholder to Text Box

19 views
Skip to first unread message

Johan Cyprich

unread,
Oct 25, 2024, 2:45:05 AM (3 days ago) Oct 25
to XMPie Interest Group
Hi. I'm trying to add a placeholder field to a text box which would replace a dial's value when the user enters a new value in it. The Automatic Preview in dynamic documents defaults in empty values which may confuse some users when looking at the preview. A Default Value can be set in the Customization Wizard Setup, but the user would have to erase the textbox before entering a new value. It would be better if the textbox value was erased when they started typing in it, which is how the placeholder function works.
I've tried using HTML Generic to create a textbox with a placeholder that displays the value, but I don't know how to link the input in the box to the dial.
Is it possible to use placeholder in textboxes?
Thanks!

Wayne

unread,
Oct 25, 2024, 5:20:40 AM (3 days ago) Oct 25
to XMPie Interest Group
I would recommend you create Feature request as I have asked for this feature many times.
Generic HTML is pretty straight forward - you need to ensure you use the CallBack function.
You didn't mention which uStore version so have assumed NG.
Hopefully this helps.


Callback Function: 
myCB

<div class="anDuEiv">
<div><input type="text" class="text-input-duc form-control" value="#DIAL_VALUE#" placeholder="Enter some text" onkeyup="myCB(this.value);">
</div>
</div>


Regards,
Wayne

Amit Cohen

unread,
Oct 25, 2024, 11:42:15 AM (3 days ago) Oct 25
to XMPie Interest Group
Hi,

The solution does not have to be in uStore, a simple way to achieve that is via rule (uPlan\uCreate).
Your dial should be a variable, let's assume called "MyDialVar" and the ADOR (that is used in the design) rule should be:

if(IsNullOrEmpty(@{MyDialVar}))
"My Default Value"
else
@{MyDialVar}

That means that if the customization of the "MyDialVar" is left empty, the default value will be shown in the preview.

You can even create a more complex rule that decides a different default corresponds to other dials already populated by a user.

Reply all
Reply to author
Forward
0 new messages