Skip to main content
Participant
Nov 1, 2016 8:36 PM UTC
Question

How to get a number with a dash to not calculate?

I have a form that has some chemicals listed. I need the EPA # to automatically fill in when I make a choice from a drop down menu. That is working. Some of the numbers have a dash in them such as 111-1. The filled in field then puts in the number 110.

I need it to stay as 111-1.

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

6 replies

try67
Community Expert
Community Expert
Nov 1, 2016 8:49 PM UTC

Are you using a script to populate the field? If so, post the full code.

Translate
Participant
Nov 1, 2016 9:01 PM UTC

if(event.willCommit)

{

console.println(event.value);

  switch(event.value)

  {

  case "Captain XTR":

  this.getField("EPANumber1").value = 67690-9;

  break;

  case "Cutrine Granular":

  this.getField("EPANumber1").value = 8959-12;

  break;

  case "Clipper":

  this.getField("EPANumber1").value = 59639-161;

  break;

  case "Reward":

  this.getField("EPANumber1").value = 100-1091;

  break;

  default:

  this.getField("EPANumber1").value = 0;

  break;

  }

}

Translate
Participant
Nov 1, 2016 9:02 PM UTC

The resulting field for Captain is 67681.

Translate