Page 1 of 1

Getting Partial Data From Fields on a Screen

Posted: Thu Jun 26, 2008 6:52 am
by Profound Logic
Q:
How do I get partial data from fields on the screen.

A:
The get() function gets a value from the screen using an id. But if you wanted get partial data simply attach the appropriate JavaScript function to the end of the expression. For example:

Script: get(“D_5_2”).substr(0, 5)

Strings are 0-based in JavaScript. So, substr(0,5) grabs 5 characters starting with the first character (character 0). You can, of course, use any of the other JavaScript function as well to massage and format the data as you wish.