NetSuite: Remove Options from Online Form Dropdown Fields

When using NetSuite online forms with HTML templates, you can add standard dropdown fields. Sometimes standard dropdown fields can contain options that you don't want included. An easy workaround for this, is to use the script tag in the HTML of your template to remove those options.

The following example shows how to remove some states from the state field. Since selectedIndex represents the rank or order number an option is from a dropdown, every line that deletes, changes the selectedIndex of the succeeding lines appropriately.

<script>
  document.getElementById("state").remove(document.getElementById("state").selectedIndex = "5");
  document.getElementById("state").remove(document.getElementById("state").selectedIndex = "5");
  document.getElementById("state").remove(document.getElementById("state").selectedIndex = "5");
  document.getElementById("state").remove(document.getElementById("state").selectedIndex = "9");
  document.getElementById("state").remove(document.getElementById("state").selectedIndex = "39");
</script>

Comments