Move widget on text entry...dollar sign

I have a text field and a dollar sign in front of the field.

I want to move the dollar sign to the left as the text field expands with larger numbers.

Is there a way to:

  1. Just script in a dollar sign + space into the text field?

or

  1. Move the dollar sign widget as the text field expands?

You could do either of these approaches, depending on how you want it to look and what you’re doing with the value in your text field.

The first, including $ in the field, will make calculations and error handling more difficult. You’d have to strip it out to get a numerical value. You can do that with something like [[This.text.substring(2)]] which evaluates to everything in the string after the first two characters—the dollar sign and space. Also, users would be able to select everything in the field and delete it, or keep backspacing to remove the “$ “. You could try to add it back in with a condition on the field’s OnTextChange, so that if the field length is less than 2 it is set to “$ “.

Your second approach is probably the better one. How/where are you increasing the size of the input field? Just add a statement after that to move the widget with “$ “ to the field’s left minus the width of the “$ “ widget. So, if that widget is named, Dollar, and your text field is named, MyAmount, it would look something like “Move Dollar to [[LVAR1.left - Target.width]]” (Where LVAR1 is a local variable for the widget MyAmount.

If this is not making sense, you can upload your .rp file and I can show you examples of how to do this.

That made total sense!

“Move Dollar to [[LVAR1.left - Target.width]]”

I should have thought of this one. That will probably work pretty easy for this instance.

Thanks!