JavaScript > JavaScript for Acrobat API Reference > JavaScript API > event > event properties > value

value
 
This property has different meanings for different field events:
For the Field/Validate event, it is the value that the field contains when it is committed. For a combo box, it is the face value, not the export value (see changeEx).
For example, the following JavaScript verifies that the field value is between zero and 100:
		if (event.value < 0 || event.value > 100) {
			app.beep(0);
			app.alert("Invalid value for field " + event.target.name);
			event.rc = false;
		}
For a Field/Calculate event, JavaScript should set this property. It is the value that the field should take upon completion of the event.
For example, the following JavaScript sets the calculated value of the field to the value of the SubTotal field plus tax.
		var f = this.getField("SubTotal");
		event.value = f.value * 1.0725;
For a Field/Format event, JavaScript should set this property. It is the value used when generating the appearance for the field. By default, it contains the value that the user has committed. For a combo box, this is the face value, not the export value (see changeEx for the export value).
For example, the following JavaScript formats the field as a currency type of field.
		event.value = util.printf("$%.2f", event.value);
For a Field/Keystroke event, it is the current value of the field. If modifying a text field, for example, this is the text in the text field before the keystroke is applied.
For Field/Blur and Field/Focus events, it is the current value of the field. During these two events, event.value is read only. That is, the field value cannot be changed by setting event.value.
Beginning with Acrobat 5.0, for a list box that allows multiple selections (see field.multipleSelection), the following behavior occurs. If the field value is an array (that is, multiple items are selected), event.value returns an empty string when getting, and does not accept setting.
Type
Various
Access
R/W