2 Replies Latest reply on Nov 2, 2010 8:54 AM by Gupta S

    Form help with auto populating fields


      Hello All,



      I am new to the forum. I am having a problem auto populating fields. I used the dynamic interactive purchase order form sample as a starting point. I had the form working and it would auto populate my products part numbers, descriptions and prices. So I thought it would be nice if it would auto populate the quantities field too. That is where the problem started.




      The way our pricing works is customers have to buy on contracts for a certain amount of time. I wanted to have the correct quantities listed for each product. Ex: a 3 month contract requires 13 for the quantity, 6 months requires 26…




      I struggle with java scripts. I am not a java script programmer I just try and follow the pattern. Usually I do OK. The changes I made to this form were in the partNoScript in the variables section and in the txtPartNum change event. I tried to add the numQty field. I think the problem exists in the function section of the partNoScript where I added the info about the itemQty (naming problem with fields?). Now nothing works. I am lost and would greatly appreciate any help. The problem file is attached.




      One last thing, this is all very new to me (Adobe LiveCycle) and any instructions or advice please make it very detailed and assume I know nothing about scripting. Not knowing how to solve this is driving me crazy. I can usually find answers to this kind of stuff by searching the forums or the Internet in general. This time I can't find the answer because I am not really aware of where the problem is. I am accustomed to being the one that everyone comes to with computer issues - I am a network administrator, unfortunately I do not have a great deal of experience programming in java. If anyone wants help with Crestron programming I can help. I just don't know Java script and am usually frustrated because of it. Trying to learn but still frustrated.



      Also, can anyone recommend a good reference book on java script or a good basic programming book that would give me a solid foundation for some of this stuff? I think this program is amazing and I can see numerous applications for our office. I just need to learn to operate the program to its best advantage.



      Thanks in advance,



      Trish Kemke

        • 1. Re: Form help with auto populating fields
          Trish_Kemke Level 1

          Hello All,



          I was going to remove this post because I solved the problem myself. However I thought I might leave it up as an example of how one little out of place comma can stop your whole script from running. And because I thought someone might need to see how the Adobe sample dynamic interactive purchase order form partNoScript (listed in the variable section) can be edited by adding a variable and an array to the script and editing the txtPartNum field change event getDesc line to include the new variable.



          If you look at the attached form in the partNoScript the last quantity listed in the “var partQty new array” has an extra comma before the final close paren. If you remove this last comma the script runs.



          Thanks to anyone that was trying to work this out. Maybe this will help someone looking to edit that script or build a different script with multiple fields being auto populated based on a drop down box selection.




          • 2. Re: Form help with auto populating fields
            Gupta S

            Hello there,

            I have a similar issue. I am new to javascripting.

            I need a script to populate a drop down list of material  numbers from a table at backend r/3 system & a script to populate two other fields based on one selection of the drop down list.

            Could you please provide a detailed description of the same? Or send the xdp format of your attached pdf file?

            Thank you,