To be clear, my client would like to enter the number of feet and have it return (appended) with the feet symbol as well as 0 inches.
So for example, if I were to input 30 into the field, I would like it to return the number formatted as 30' 0".
Any help is greatly appreciated! I know it's not a difficult script, but as I said, I am quite lost when it comes to js.
You need to better explain how this is supposed to work. How would they enter 30' 6", for example? 30.5? 30.6? Something else?
Also, do you want to change the actual value of the field, or just how it is displayed? Or maybe use two separate fields? (I think that's a better approach, personally)
Thank you for responding try67!
They would like to enter the number, then have the number show up (unchanged) with the feet symbol, followed by 0" (inches will always be 0). They need to be in the same field.
So if they enter "50", it should appear on the form (in the text field) as 50' 0".
I have figured out how to get it to show in feet with the zero following, just having trouble getting the inch marks in as well...
I used the below to get it somewhat working...
// Custom Format script for text field
if (event.value) event.value += "'" + "0";
if (event.value) event.value += "' 0\"";
You are amazing, thank you!
What if one wanted to have it display 1'10" entered as 1.10
Use this code:
if (event.value) event.value = event.value.replace("'", ".").replace("\"", "");