Skip to main content
Participant
Aug 9, 2024 6:09 PM UTC
Question

Adobe Form Field Calculation OR Script Needed ASAP

I want to create a basic form that several different people will use. In this form, the user would enter a measurement in inches but when they tab or press enter, I would like their entry to convert automatically to feet & inches based on their input.

 

Does that make sense?

 

Example: The user puts in 115" and then goes to the next field. It would change the entry to 9.58' (the actual is 9.58333')

 

Here is a screenshot of the form fields.

 

 

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

4 replies

try67
Community Expert
Community Expert
Aug 9, 2024 6:16 PM UTC

Enter this code as the custom Format script of the field (under Properties - Format - Custom):

 

if (event.value) {
	event.value = (Number(event.value.replace("\"", ""))/12).toFixed(2) + "'";
}
Translate
Participant
Aug 9, 2024 6:27 PM UTC

When I enter the above into the Javascript editor box, I have the option to cancel to Go To. When I click the Go To button, it is asking for me to enter a Line Number???

Translate
try67
Community Expert
Community Expert
Aug 9, 2024 9:08 PM UTC

Make the window larger by dragging one of its corners and you'll see an "OK" button.

Translate
Participant
Aug 9, 2024 6:12 PM UTC

Additional Note: I am not an expert and I do not know how to write scripts etc. Please explain in layman's terms 🙂

Translate