Skip to main content
Known Participant
March 2, 2019
Answered

show dimensions

  • March 2, 2019
  • 1 reply
  • 737 views

In this field I would like to type in, let's say, 33 and what I would like to show as a result would be, 3' x 3'. Or, if I enter any two digit number the field results would be in feet x feet. Figuring this out is a bit perplexing because I'm talking about a whole numbers and how would I break the number apart, put an x (for by) in between, and show the results in the same field. And, notice the spacing of the results. I have this script and was playing around with it. I got it to put the ' marks in the results. I have to type in the number like this - 3.3. The result is 3'3'. It's close but no cigar. Is it possible to have the field return the results the way I want?

Here's the javascript I'm playing around with:

event.value=this.getField("Footings1").value.toFixed(2).replace(".","' ").replace(/.$/,"' ");

This topic has been closed for replies.
Correct answer try67

Yes. You can do it using this custom validation script:

if (event.value.length==2) event.value = event.value.charAt(0) + "' x " + event.value.charAt(1) + "'";

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
March 2, 2019

Yes. You can do it using this custom validation script:

if (event.value.length==2) event.value = event.value.charAt(0) + "' x " + event.value.charAt(1) + "'";

pdfUser1Author
Known Participant
March 2, 2019

thanks again. Very, very nice.