Is there an easier way to write this script?
I am working on a custom format script for a dropdown field and i keep getting an error that the script is to long for the dialog box. I am fairly new to this and I think there is a way to write the script below to save time and space. This is just a sample of the entire script.
var f = event.target;var pos = f.currentValueIndices; //position sélectionnée
if (event.value==" Select Wildlife Management Activity")
this.getField("Caption1").value = "";
if (event.value==" Habitat Control - Range Enhancement (Re-seeding)")
this.getField("Caption1").value = "Reseeding for XX with XX\nDate:\nTotal Acres:";
if (event.value==" Habitat Control - Brush Management")
this.getField("Caption1").value = "XX Removal\nDate:\nTotal Acres";
var f = event.target;
var pos = f.currentValueIndices; //position sélectionnée
if (event.value==" Select Wildlife Management Activity")
this.getField("Caption2").value = "";
if (event.value==" Habitat Control - Range Enhancement (Re-seeding)")
this.getField("Caption2").value = "Reseeding for XX with XX\nDate:\nTotal Acres:";
if (event.value==" Habitat Control - Brush Management")
this.getField("Caption2").value = "XX Removal\nDate:\nTotal Acres";
var f = event.target;var pos = f.currentValueIndices; //position sélectionnée
if (event.value==" Select Wildlife Management Activity")
this.getField("TEXT").value = "";
if (event.value==" Habitat Control - Range Enhancement (Re-seeding)")
this.getField("TEXT").value = "Reseeding for XX with XX\nDate:\nTotal Acres:";
if (event.value==" Habitat Control - Brush Management")
this.getField("TEXT").value = "XX Removal\nDate:\nTotal Acres";
