Skip navigation
cc701
Currently Being Moderated

Making 1 field equal the value of 2 fields.

Jul 27, 2012 12:34 PM

How do I make 1 field equal the value of 2 text fields.

 

I've got text field 1 and I need it to equal the value of address field 1 and address field 2.  Essentially, I need what is in address field 1 and 2 to combine to be in one single field, text field 1.

 

Any suggestions?

 

Thanks

 
Replies
  • Currently Being Moderated
    Jul 27, 2012 1:10 PM   in reply to cc701

    Are you summing data or concatenating text strings?

     

    If it is numbers you can use the Calculation Tab'x options of "Field is the _____ of fields:" and select the operation and fields or use the Simplified Field notation if the field names comply the with the requirements for the Simplified Field Notation option.

     

    You can also use the custom JavaScript calculation and use the field names with the "getField" method and the "+" operator to add or concatenate the data. I you do not set the type of value, then JavaScript will make a guess at the type of data, string or numeric, and either concatenate the strings or add the number depending upon how JavaScript has guessed the type of data.

     

    Need help Adding

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 8:11 AM   in reply to cc701

    When in a field and trying to reference it one should use the "event.value' to access the field's value property. The value of the object field is not updated until on leaves the field. I would use:

     

    event..value = this.getField("FL052").value + this.getField("FL053").value;

     

    For the custom calculation script.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 8:12 AM   in reply to cc701

    Did you copy and paste this or type it again? I ask because there's a typo.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 8:16 AM   in reply to Test Screen Name

    Becareful when copying and pasting as MS Word Smart Quotes will caus a big problem.

     
    |
    Mark as:
  • George Johnson
    11,662 posts
    Aug 11, 2002
    Currently Being Moderated
    Jul 30, 2012 10:08 AM   in reply to cc701

    If you want to concatenate strings, you should use the valueAsString property when getting the values of fields:

     

    event.value = getField("FL052").valueAsString + getField("FL053").valueAsString;

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points