Skip to main content
Known Participant
April 26, 2019
Question

this script works but it needs to show only as seen in example

try67 was nice enough to provide this script (see below). It works great but I noticed it allows me to enter text in the field. Don't want that. The field should only allow a dollar amount to be entered and accepted. Can someone show me how to modify this bit of script to not allow text? Thank you.

script:

if (event.value) { 

    event.value = "$" + util.printf("%,0.2f", event.value) + "/ per foot"; 

}

I've placed the script under Custom Format.

This topic is closed to new replies. Start a new post to keep the conversation going.

6 replies

Inspiring
April 27, 2019

You'd need to add a custom Keystroke script. When you say you want to enter a dollar amount, do you want to allow cents as well?

Translate
pdfUser1Author
Known Participant
April 27, 2019

hi George, yes I want to show the dollars and cents. As it is right now, I can do that. Like this, if I enter 25.58 the field shows $25.58 per foot. But, if I enter some text, the field shows the text and the "per foot". Not what I want to do. It doesn't make sense. I don't know how to modify the script to do as you're saying. Would I just place the script to the Keystroke window? Would modifying this script be too complicated?

Translate
Legend
April 27, 2019

No, you'd need to write a second piece of script to control what the user types.

Or modify the first strip to remove everything that isn't one of your legal 11 characters.

Translate