Need java script to allow user input in text field if listbox selection is something else.
I'm trying to create a field that is automatically populated if a specific selection is made in a listbox. If that specific selection is NOT in the listbox then I want to be able to manually add text in that field.
See below. If I select AVLEASE, FJAUDILEASE or FJMBLEASE in the listbox, I want a field to populate with the word LEASE. If any other selection is made in my listbox, I want to be able to manually enter text into this field.
I'm using the Custom calcuation script box in the text field properties calculate tab.
This is what I have and it dosen't work. I cannot manually enter text in that field:
var v = this.getField("LISTBOXDEALER").valueAsString;
if (v=="AVLEASE") event.value = "LEASE";
else if (v=="FJAUDILEASE") event.value = "LEASE";
else if (v=="FJMBLEASE") event.value = "LEASE";
else event.value = "";
event.rc = (v != ""); // this blocks the calc
event.target.readonly = event.rc // This blocks or enables user data entry

