The correct way to code this if your items have export values is to use a custom Keystroke script, not any of the other events that you've placed the code. It could be something like:
// Custom Keystroke script
(function () {
if (event.willCommit) {
return;
}
var f1 = getField("s");
var f2 = getField("gr");
var f3 = getField("b");
// Get the export value of the selected item
var sh = event.changeEx;
// Show/hide the fields
switch (sh) {
case "1" :
f1.display = display.visible;
f2.display = display.hidden;
f3.display = display.hidden;
break;
case "2" :
f1.display = display.hidden;
f2.display = display.visible;
f3.display = display.hidden;
break;
case "3" :
f1.display = display.hidden;
f2.display = display.hidden;
f3.display = display.hidden;
break;
default :
// If some other combo box item is selected
// add additional code
break;
}
})();
But since this will get misformatted by the forum software, here's what it really should look like: http://pastebin.com/8Uq3FJEb
Before I was trying to get you to realize that your variable sh wasn't getting assigned the value you were expecting.