Forums

how to change input box value by drop down selection

fkaram65 29 Jan, 2013
Hi All,

just getting back into chronoforms after a year layoff. I am trying to get this text box value to update, with no luck, based on a drop down selection. Edited some code from another thread but still can not get it to work. I appreciate any help, kind of rusty.

Thanks.
window.addEvent('domready', function() {
  
  var school, team;
  school = $('input_school_district');
  team = $('input_team');
  
  switchTeam();
  school.addEvent('change', switchTeam);
  
  function switchTeam() {
    if ( school.value == 'Hillside' ) {
      team.value = "Colts";
    } else {
      team.value = "Stallions";
      
    }
});
GreyHead 29 Jan, 2013
Hi fkaram65,

The code looks OK to me. Please post a link to the form so I can take a quick look.

Bob
This topic is locked and no more replies can be posted.