Using Combo box to generate text

Previous topic - Next topic

Sean_Fernando

Hi everyone,

I need some help coming up with the proper javascript code for my interactive form.

I have certain classes in the combo box, such as "Sales", "Clerk", "Temp" and etc. Basically what I want to do is program the text field below the combo box to show a text every time a different class in the combo box is selected. This is probably very easy to do, but I'm a beginner and I have little idea as to how to approach this. Here are my boxes.



I have certain classes in the combo box, such as "Sales", "Clerk", "Temp" and etc. Basically what I want to do is program the text field below the combo box to show a text every time a different class in the combo box is selected. This is probably very easy to do, but I'm a beginner and I have little idea as to how to approach this.

In my textfield I've tried the following javascript with no success:

var one = this.getField("Text57");
var two = this.getField("Polygon101");
if (one.value == 'Sales') {
    two.value='Package A'
}

So here, every time the user selects the "Sales" class in the combo box, I want the text field to read: "Package A". Don't know if this code is right.

Please any help will be appreciated. Thank you. :)