title: Add value from other option to a dropdown list
body: <p>I am using a platform called Kintone and am trying to add in custom Javascript in order to allow for there to be a drop-down list of options that has an 'other' option. If the user selects the other option, they can enter in what they want to put into this field and then submit the value and it will then be saved on the drop-down list. Attached below is code pulled from the <a href="https://developer.kintone.io/hc/en-us/articles/115009553188" rel="nofollow noreferrer">help page</a> of Kintone which allows for the other button to pull up a separate text field to store the value that the user wants. I'm thinking that there needs to be some small edit on this in order to allow for the value to be saved in the dropdown list itself instead of in the separate text field. I am not sure if this is a Kintone specific question (I know it's not very commonly used) or if it can be accomplished just with Javascript knowledge (which I largely lack :( ). Thank you in advance for the help!</p>
  
  <pre><code>(function () {
  "use strict";
  
  var RADIOBUTTON = "allergies";
  var MULTICHOICE = "cause";
  var TEXTFIELD = "other";
  var RADIO_VALUE = "Yes";
  var MULTI_VALUE = "Other";
  
  //Events for detail, create and edit pages
  var events = ['app.record.detail.show',
                'app.record.create.show',
                'app.record.create.change.' + RADIOBUTTON,
                'app.record.create.change.' + MULTICHOICE,
                'app.record.create.change.' + TEXTFIELD,
                'app.record.edit.show',
                'app.record.edit.change.' + RADIOBUTTON,
                'app.record.edit.change.' + MULTICHOICE,
                'app.record.edit.change.' + TEXTFIELD];
  
  kintone.events.on(events, function(event) {
  
      var record = event.record;
  
      //Hide/unhide fields depending on field choices
      if (record[RADIOBUTTON]['value'] === RADIO_VALUE) {
          kintone.app.record.setFieldShown(MULTICHOICE, true);
  
          //If "Other" is not selected for the allergy cause, don't show a text field
          var fieldValue = record[MULTICHOICE]['value'];
          if (fieldValue.length === 0) {
              kintone.app.record.setFieldShown(TEXTFIELD, false);
          }
  
          //If "Other" is selected for the allergy cause, show a text field
          for (var i = 0; i &lt; fieldValue.length; i++) {
              if (fieldValue[i] === MULTI_VALUE) {
                  kintone.app.record.setFieldShown(TEXTFIELD, true);
              }else {
                  kintone.app.record.setFieldShown(TEXTFIELD, false);
              }
          }
      }else {
          // If "No" is slected for "Do you have any food or drug allergies?", hide other fields
          kintone.app.record.setFieldShown(MULTICHOICE, false);
          kintone.app.record.setFieldShown(TEXTFIELD, false);
      }
  });
  })();
  </code></pre>