2 Replies Latest reply on Oct 20, 2013 12:00 PM by dvsone99

    Need help with Java Script

    dvsone99

      I need to populate a Phone number Txt Field based on my drop down box selection

       

      example

       

      I pick ASIG from drop down I need 123-456-7899 to populate the phone number txt field

       

      if i pick SBA from the drop down i need 987-654-3211 to populate the phone number txt field

       

      I am new to Java script,

       

      please be gentle

       

      I will have 7 options in my drop down box,  so i need to have 7 different numbers populate the txt box

        • 1. Re: Need help with Java Script
          George_Johnson MVP & Adobe Community Professional

          If you set the export value of each item to the corresponding phone number, the custom Keystroke script of the dropdown can be as simple as:

           

          // Custom Keystroke script for dropdown

          if (!event.willCommit) {

              getField("phone_num").value = event.changeEx;

          }

           

           

          but replace "phone_num" with the actual name of the text field. To enter a custom Keystroke script, select the Format tab and then a Format Category of Custom and you'll see where to enter the script. On the Options tab, select "Commit selected value immediately" as well.

           

          If you don't want to set the export value of the items for some reason (there may be good ones), post again for a different approach.

          • 2. Re: Need help with Java Script
            dvsone99 Level 1

            Thank you so MUCH