INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Combo box and document array to work with spawning

Combo box and document array to work with spawning

(OP)
Hi,
I have a form that I need to spawn pages. As it is now I have a document array and a combo box. When a selection is made in the combo box, the StateAmt field is populated from the array. This all works fine now, but I need to be able to make this coding work with spawned pages and need a little help.

This is my document javascript:
var gState = new Array //Create a reference to a new array
//load the array up with the amounts for each state
gState["AL"]=40
gState["AK"]=40
gState["AR"]=40
gState["AZ"]=25
gState["CA"]=25
....and so on, I deleted most to make the script shorter here

this is my custom keystroke script for combo box 'gstate' (fyi, i added the state initials in the combo box options tab)
var stateamt = this.getField("G876.StateAmt")
if (event.changeEx in gState)
stateamt.value = gState[event.changeEx]

this works great for one page but when I add another page (spawned template) nothing happens after makeing a selection in the combo box. I'm sure I need to alter the script due to spawing changes the field names on each page, but I don't know how. I tried renaming the combo to gState1 and using this script (which does not work)

var fna = event.target.name.split(".");
var fp = fna.length>1?fna[0]+"."+fna[1]+".":"";
var stateamt = this.getField(fp + "G876_StateAmt").name // (this is G876.StateAmt on the original form)
var gst = this.getField(fp + "gState1").name //(this is gState on the original form)

if (event.changeEx in gst)
stateamt.value = gst[event.changeEx]


If anyone can help me with this, I would be so greatful.
Thanks
Lisa

RE: Combo box and document array to work with spawning

Are you using the rename parameter when you spawn the new page?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close