Need help on pdf JS

I have developed a document DWH script to define the efficiency of the Domestic Water Heater (DWH) and set whether or not it is co-vented along with other combustion equipment. The latter two properties are dependent on DWH energy source and DWH type used.

Following published examples, I managed to output the correct DWH efficiency for each pair of DWH energy source and DWH type; however, I was unable to get the correct output for the co-vented field. This should be either “Yes” or “No”. I am sure I am making a very amateurish mistake, but I cannot figure out what.

The following is the document script:

var oDWHEnergySources = { 
NG: [ ["-","None","None"], ["Conventional Tank without pilot",0.55,"Yes"], ["Conventional Tank with pilot",0.55,"Yes"], ["Tankless Coil",.48,"No"],["Instantaneous-direct vent cond",0.83,"No"],["Instantaneous w/ Pilot",0.83,"No"],["Instantaneous condensing",0.80,"No"],
["Induced Draft Fan with ignitor",0.57,"No"],["Induced Draft Fan with pilot",0.57,"No"],
["Direct vent (sealed)",0.58,"No"],["Condensing",0.86,"No"]],
Oil: [ ["-","None","None"], ["Conventional tank",0.53,"Yes"],["Tankless Coil",0.40,"No"]],                       
Electricity:  [ ["-","None","None"], ["Conventional Tank",0.82,"No"], ["Conserver Tank",0.87,"No"], ["Instantaneous",0.94,"No"],["Tankless Heat Pump",190,"No"],["Heat Pump",190,"No" ]],};        


function SetDWHTypeEntries()
 {
     if(event.willCommit)

   { 

      var lst = oDWHEnergySources[event.value];

      if( (lst != null) && (lst.length > 0) )
         this.getField("DWHType").setItems(lst);
      else
      {
         this.getField("DWHType").clearItems();
      }
      this.getField("DWHEfficiency").value = 0;
      this.getField("Covented").value = 0;
  }  
}
function SetDWHEfficiency()
{
   if(event.willCommit)
   {
      var nSelExp = 0;
      if(!isNaN(event.changeEx))
        nSelExp = event.changeEx
      this.getField("DWHEfficiency").value = nSelExp;
   }
}
function SetCovented()
{
   if(event.willCommit)
   {
      var nSelExp = 1;
      if(!isNaN(event.changeEx))
        nSelExp = event.changeEx
      this.getField("Covented").value = nSelExp;
   }
}

I have also attached some pictures of the pdf page and fields

How do I set “Covented” field to 1?

How do I set the value of event.changeEx?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.