Hello- I really need some help. I created a script to auto-populate some text fields from the drop down selection that is chosen. The script was accepted but will not work. Is there something I did incorrectly. The script is listed below:
//Place all pre-populated data into a structure var servicedata={Activation Only:{subone:"Device Model",subtwo:"SIM/IMEI/MSN/DEC/MEID",subthree: "Username"},Cancellation:{subone:"Existing Phone Number",subtwo:"Reason for Cancellation"},Feature Change:{subone:"Existing Phone Number",subtwo:"What change is needed?"},New Line/Phone Order:{subone:"Device Model/Type",subtwo:"Shipping Address"},Port Order:{subone:"Current Account Number",subtwo:"Device Model/Type",subthree:"Existing Phone Number",subfour:"Shipping Address",subfive:"What is needed?",subsix:"If new phone is needed, which one?"},Swap:{subone: "Existing Phone Number",subtwo: "SIM/IMEI/MSN/DEC/MEID",subthree: "What type of new phone did you receive?"},Transfer of Liability :{ subone: "AOL/TOL Form filled out and attached Yes or No?",subtwo:"Existing Phone Number",subthree:"Current Account Number",subfour:"Please list new account number and carrier to Transfer to"},Upgrade Order:{subone:"Device Model/Type",subtwo:"Existing Phone Number",subthree:"Shipping Address",subfour:"What phone do you need?",subfive: "Other information"},Warranty Replacement:{subone: "Device Model/Type",subtwo:"Existing Phone Number",subthree:"Phone problem",subfour:"Shipping Address"}};
function SetFieldValues(cservselect)
{
//Populate Fields with values from the Service Data Object
this.getfield("sub1").value = servicedata[cservselect].subone;
this.getfield("sub2").value = servicedata[cservselect].subtwo;
this.getfield("sub3").value = servicedata[cservselect].subthree;
this.getfield("sub4").value = servicedata[cservselect].subfour;
this.getfield("sub5").value = servicedata[cservselect].subfive;
this.getfield("sub6").value = servicedata[cservselect].subsix;
this.getfield("sub7").value = servicedata[cservselect].subseven;
this.getfield("sub8").value = servicedata[cservselect].subeight;
}
if( event.willCommit ) { if(event.value == "") this.resetForm(["sub1","sub2","sub3","sub4","sub5","sub6","sub7","sub8"]); else SetFieldValues(event.value); }
function SetFieldValues()
{//Place all pre-populated data into a structure var servicedata={Activation Only:{subone:"Device Model",subtwo:"SIM/IMEI/MSN/DEC/MEID",subthree: "Username"},Cancellation:{subone:"Existing Phone Number",subtwo:"Reason for Cancellation"},Feature Change:{subone:"Existing Phone Number",subtwo:"What change is needed?"},New Line/Phone Order:{subone:"Device Model/Type",subtwo:"Shipping Address"},Port Order:{subone:"Current Account Number",subtwo:"Device Model/Type",subthree:"Existing Phone Number",subfour:"Shipping Address",subfive:"What is needed?",subsix:"If new phone is needed, which one?"},Swap:{subone: "Existing Phone Number",subtwo: "SIM/IMEI/MSN/DEC/MEID",subthree: "What type of new phone did you receive?"},Transfer of Liability :{ subone: "AOL/TOL Form filled out and attached Yes or No?",subtwo:"Existing Phone Number",subthree:"Current Account Number",subfour:"Please list new account number and carrier to Transfer to"},Upgrade Order:{subone:"Device Model/Type",subtwo:"Existing Phone Number",subthree:"Shipping Address",subfour:"What phone do you need?",subfive: "Other information"},Warranty Replacement:{subone: "Device Model/Type",subtwo:"Existing Phone Number",subthree:"Phone problem",subfour:"Shipping Address"}};
function SetFieldValues(serviceselect)
{//Populate Fields with values from the Service Data Object
this.getField("sub1").value = servicedata[serviceselect].subone;
this.getField("sub2").value = servicedata[serviceselect].subtwo;
this.getField("sub3").value = servicedata[serviceselect].subthree;
this.getField("sub4").value = servicedata[serviceselect].subfour;
this.getField("sub5").value = servicedata[serviceselect].subfive;
this.getField("sub6").value = servicedata[serviceselect].subsix;
this.getField("sub7").value = servicedata[serviceselect].subseven;
this.getField("sub8").value = servicedata[serviceselect].subeight;
}
}