Skip to main content
Participant
February 1, 2016
Question

Java Script: Concatenate Combo selections

  • February 1, 2016
  • 0 replies
  • 243 views

Hello Guys,

I went through a lot of web pages and forum and before ending up buying a big book - which won't guarantee a solution - I would like to get your opinion...

Name 1/2/3/4 are COMBO BOXES. I am getting a String with each combo's selection.

questions:

1. how can I clear the string to allow new selection?

2. how can I properly implement the function string.substring(n1,n2) in the script below in order to get only the first two/one digit of each string?

//set the vars

var five = this.getField("Name5");

//this function that checks if the destination field is blank and if so popluates it.

function collatePreSetFieldsTo(populate){

  //always overwrite the value in populate field

  //if(populate.value==''||populate.value==null){

  var one = this.getField("Name1");//COMBO BOX 1

  var two = this.getField("Name2");//COMBO BOX 2

  var three = this.getField("Name3");//COMBO BOX 3

  var four = this.getField("Name4");//COMBO BOX 4

  populate.value=one.value + ' ' + two.value + ' ' + three.value + ' ' + four.value;

  //}

}

collatePreSetFieldsTo(five);

I really appreciate whatever you guys can recommend...

Thanks a lot

FL

This topic has been closed for replies.