2 Replies Latest reply on May 11, 2016 8:08 AM by JeffBPaarsa

    Not sure what could be wrong with my script...

    JeffBPaarsa Level 1

      Hello,

       

      In a multipage form that on all the pages have the First Name, Last Name, first FName, and LName on the First page is unprotected and open for entry but following FName, LName on the other pages are protected ReadOnly with small twist on the filed names like HFName, HLName , AFName, ALName.....

       

      What I want to do is that entry on the first page for FName, LName to be propagated on the other pages, so I run the following codes on the Validate tab or FName... LName is entered first then next field to be entered is FName.

      =======================================

      var aInput = event.value.split(" "); // make an array split at space

      var sCharacter = '';

      var sWord='';

      // for each element of word array, capitalize the first letter

      for(i = 0; i <aInput.length; i++)

         {

          aInput[i] = aInput[i].substr(0, 1).toUpperCase() + aInput[i].substr(1).toLowerCase();

         } // end loop for input string

      // rebuild input string with modified words with spaces

      event.value = aInput.join(' ');

      getField("HLName").value = getField("LName").value;

      getField("HFName").value = getField("FName").value;

      getField("LFName").value = getField("LName").value + ", " + getField("FName").value;

      ======================================

      HLName is get populated but HFName is left empty on the 2nd page and LFName on the third page which was supposed to come out like "Llllllll, Ffffffff" comes out as "Llllllllll," no FName at the end...

      I can't understand why the full code does not get executed... It is interesting that LName only runs the Validation part of the code not the copying to the other fields.

       

      LName field

        

      FName field

      Let me know if you need more info.

       

      Regards,

      Jeff P...