Lookup table is easiest. External file may be best. You have to decide that part.
Lookup table is trivial:
Code:
var phrases = [
null, /* 0 is never used */
"this is phrase 1",
"this is phrase 2",
..
"this is phrase 140"
];
var chosenPhrase = phrases[document.getElementById('datamem14').value];
if ( chosenPhrase == null ) chosenPhrase = "That is not a valid selection";
As an alternative, if you wanted the value from
datamem14 to be something other than a number form 1 to 140:
Code:
var phrases = {
"auto" : "This is automatic",
"manual" : "5 speed on the floor",
"chain" : "Must be a bicycle",
...
}
var chosenPhrase = phrases[document.getElementById('datamem14').value];
if ( chosenPhrase == null ) chosenPhrase = "That is not a valid selection";