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

Field Won't Refresh Unless Lose Focus

melvinsb12
Registered: Mar 27 2011
Posts: 2

Hi All,
I want to have a text field show one of a set of 3 values (blank, 2, 4) based on its current value. The values are to cycle in response to successive mouse down events (clicks). The following code seems to work but doesn't refresh the text box value ...
============================================
 
var et = event.target;
 
try{
if (et.value!= undefined)
{
if (et.value == "")
et.value = '2';
else
if (et.value == '2')
event.target.value = '4';
else
event.target.value = '';
}
} catch(err){
app.alert(err.toString());
}
============================================
 
Thanks for your help.

Melvin S. Bernstein

My Product Information:
Acrobat Pro 10.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You might want to use a button for this and dynamically change its caption. If you need a text field, you can use a hidden text field in addition to the button and change its value when you change the button caption.
melvinsb12
Registered: Mar 27 2011
Posts: 2
Hi George,
Thanks for the suggestion. Let me further explain. The form includes a checklist with about 50 items. Each item can be assigned a value of 2, 4, or simply left blank. The values can be entered by keyboard but allowing a click on the item field to populate a given item score seems like it would be a nice option for users. A grand total is calculated based on these values. Imho, using 50 buttons would clutter the form.

Melvin S. Bernstein