Array Set-Up Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kc

    Array Set-Up Question

    Hello All

    I put this array on the document level of an Acrobat form

    var gmagazine = new Array
    gmagazine["mhm"] = "48"
    gmagazine["mhm"] = "12"
    gmagazine["mhm"] = "20"

    I then put this on a drop down list field of the form

    var trimFld = this.getField(" spec_trim")
    var liveFld = this.getField(" spec_live")
    var bleedFld = this.getField(" spec_bleed")

    if (event.changeEx in gmagazine)
    trimFld.value = gmagazine[event.changeEx]

    My goal is that when the export value of mhm is selected via the combo
    box, these values will diaplay as follows:
    48 will appear in the text field "spec_trim"
    12 will appear in the text field "spec_live"
    20 will appear in the text field "spec_bleed "

    I know as currently constructed, the array will only work if I have one
    text
    field associated with the export value of "mhm". How do I create an
    array
    that allows for three separate values (for spec_trim, spec_live and
    spec_bleed, from a single export value of "mhm"

    Is this possible?

    Thanks in advance for any assistance.

    Kenn





    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • KC

    #2
    Re: Array Set-Up Question

    I posted an example of what I am trying to accomplish at
    http://www.polar.icestorm.com/sfl/array_example.pdf Please let me know if
    you have any ideas on this.


    "kc" <clemke@email.t oast.net> wrote in message
    news:407f134e$0 $205$75868355@n ews.frii.net...[color=blue]
    > Hello All
    >
    > I put this array on the document level of an Acrobat form
    >
    > var gmagazine = new Array
    > gmagazine["mhm"] = "48"
    > gmagazine["mhm"] = "12"
    > gmagazine["mhm"] = "20"
    >
    > I then put this on a drop down list field of the form
    >
    > var trimFld = this.getField(" spec_trim")
    > var liveFld = this.getField(" spec_live")
    > var bleedFld = this.getField(" spec_bleed")
    >
    > if (event.changeEx in gmagazine)
    > trimFld.value = gmagazine[event.changeEx]
    >
    > My goal is that when the export value of mhm is selected via the combo
    > box, these values will diaplay as follows:
    > 48 will appear in the text field "spec_trim"
    > 12 will appear in the text field "spec_live"
    > 20 will appear in the text field "spec_bleed "
    >
    > I know as currently constructed, the array will only work if I have one
    > text
    > field associated with the export value of "mhm". How do I create an
    > array
    > that allows for three separate values (for spec_trim, spec_live and
    > spec_bleed, from a single export value of "mhm"
    >
    > Is this possible?
    >
    > Thanks in advance for any assistance.
    >
    > Kenn
    >
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it![/color]


    Comment

    • mscir

      #3
      Re: Array Set-Up Question

      kc wrote:[color=blue]
      > var gmagazine = new Array
      > gmagazine["mhm"] = "48"
      > gmagazine["mhm"] = "12"
      > gmagazine["mhm"] = "20"
      > var trimFld = this.getField(" spec_trim")
      > var liveFld = this.getField(" spec_live")
      > var bleedFld = this.getField(" spec_bleed")
      > if (event.changeEx in gmagazine)
      > trimFld.value = gmagazine[event.changeEx]
      > My goal is that when the export value of mhm is selected via the combo
      > box, these values will diaplay as follows:
      > 48 will appear in the text field "spec_trim"
      > 12 will appear in the text field "spec_live"
      > 20 will appear in the text field "spec_bleed "[/color]
      <snip>

      I'm not sure if this applies to pdf files because I don't understand
      your code. This works in an html page. Maybe you can use or modify this
      approach:

      - use a 2 dimensional array
      - match array index data with select index

      <script type="text/javascript">
      var gmagazine = new Array();
      gmagazine[1] = new Array();
      gmagazine[1] = ["48","12"," 20"];
      gmagazine[2] = new Array();
      gmagazine[2] = ["100","200","30 0"];

      function processlistpick (num) {
      var frm=document.fo rms["form1"];
      frm.trim.value = gmagazine[num][0];
      frm.live.value = gmagazine[num][1];
      frm.bleed.value = gmagazine[num][2];
      }
      </script>
      </head>
      <body>
      <form name="form1">
      <select name="List1" OnChange="proce sslistpick(this .selectedIndex) ">
      <option>Choos e A Publication</option>
      <option>MHM - Miluakee Home</option>
      <option>Other - ___________</option>
      </select>
      <br>
      <br>
      <input type="text" length=12 name="trim">&nb sp;
      <input type="text" length=12 name="live">&nb sp;
      <input type="text" length=12 name="bleed">&n bsp;
      </form>

      Comment

      Working...