Populate to another text field from dropdown list and the user enter custom text, is it possible?
- December 3, 2020
- 1 reply
- 389 views
I'm hoping if someone can tell me if this is even possible.
I have a dropdown list of work orders the user can select from which populates the number to another field called WO1. The WO1 text field also has a custom calculation script that adds a slash and period to the number ie. /11223344.
Is it possible for the user to be able to enter custom text in the same dropdown text field without choosing from the list and still have what they entered populate to the WO1 text field?
Thanks!
//CUSTOM KEYSTROKE ON DROPDOWN TEXT FIELD
if( event.willCommit )
{
if(event.value == " ")
this.resetForm(["WO1","UnitofMeasure1"]);
else
SetFieldValuesWO1(event.value);
}
//JAVASCRIPT DOCUMENTATION
var WOData = { "112233 Inspection":{ WO: "112233",
UOM: "Hrs" },
"445566 General Maintenance":{ WO: "445566",
UOM: "Hrs" },
"778899 Customer Service" :{ WO: "778899",
UOM: "Hrs" }};
function SetFieldValuesWO1(cWOName)
{
this.getField("WO1").value = WOData[cWOName].WO;
this.getField("UnitofMeasure1").value = WOData[cWOName].UOM;
}
//CUSTOM KEYSTROKE IN WO TEXT FIELD
if (event.value) event.value = "\\" + event.value + ".";
