2 Replies Latest reply on Sep 13, 2012 10:49 AM by ahlaj77

    Zero infront of zipcode getting cut off, need help

    ahlaj77 Level 1

      Not showing full zip code – I put in 07753 and it shows 7753 (missing the 0). Thank you for your help!

       

      Here is my code:

       

      var v7 = this.getField("ShipTo");

      var v1 = this.getField("ZipPostal Code").value;
      var v2 = this.getField("ZipPostal Code_2").value;


      if(v7.value == "0")
      {      
          if(v1.length === 0)
          {
            v1 = "";
          }
          else
          {
            v1 = this.getField("ZipPostal Code").value;
          }   

      event.value = v1;

      }

      else if(v7.value == "1")
      {


           if(v2.length === 0)
           {
                  v2 = "";
           }
           else
           {
                  v2 = this.getField("ZipPostal Code_2").value;
           }


      event.value = v2;
      }