These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Formatting NumField & Keeping ImageField from edition

clueless1942
Registered: Jun 14 2010
Posts: 23
Answered

Hi, I've got two different short questions:
 
a) I'd like to format a Numeric Field, in order to let the user enter integers from 0 to 360 (degrees). I know I can limit the number of digits as a "Comb of X characters", but I don't want the field to appear splitted into "boxes".
 
Can I set a pattern for my case?
 
b)I've got an image field inserted into a form that will be complimented by Acrobat Pro & Reader users, and i'd like to block the image so that no Acrobat user except me could modify the image.
 
Thank you so much in advance.

My Product Information:
LiveCycle Designer, Windows
Niall
Expert
Registered: Apr 26 2006
Posts: 62
Accepted Answer
Hi,

a) you could use script in the exit event of the numeric field to check the value that the user has inputted and to take appropriate action. EG if they enter greater than 360 degrees it would change it back to a maximum of 360.

if (this.rawValue > 360){this.rawValue = 360;}
b) you have at least two options. First you could use an image object (instead of an imageField object). This would mean that you would have to edit the form in LC Designer to change the image source.

Another option would be to have an image object but include this script in the docReady event:

this.access = "readOnly";
Then if you pick another field (like a textfield) you could have the following script in the exit event:

if (this.rawValue == "Open Sesame") // your secret password
{
imageField1.access = "open";
}
else
{
imageField1.access = "readOnly";
}

Now this is not 100% secure, as the "password" is hardwired into the form. There are ways to secure this with HASH codes, but this might be sufficient for you.

Hope this helps,

Niall
Assure Dynamics

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You could also use the 'validate' script action. You need write a script that evaluates to a logical true or false.

($.rawValue >= 0 & $.rawValue <= 360)You can then set the object's "Value" "Validation Script Message" by checking the option and enter a message like:

Enter a whole number between 0 and 360.

You can set your field's formats to "zz9".

George Kaiser

clueless1942
Registered: Jun 14 2010
Posts: 23
Thanks a lot, to both of you, [b]gkaiseril[/b] & [b]Niall[/b].I don't know how could I not see there were TWO image related fields. on the numeric field matter, I must have made a mistake with the patterns (I had set them to "zz9" prior to posting here, BTW), but the script was the simplest solution, of course.


clueless1942
Registered: Jun 14 2010
Posts: 23
Thanks a lot, to both of you, [b]gkaiseril[/b] & [b]Niall[/b].I don't know how could I not see there were TWO image related fields. on the numeric field matter, I must have made a mistake with the patterns (I had set them to "zz9" prior to posting here, BTW), but the script was the simplest solution, of course.