Sir,
Actual file link : https://www.dropbox.com/s/0508by0lmlf77rc/repeatable%20Dropdown%20to%20another%20Dropdown%20which%20...
I have a Table of which Row2 is repeatable which contain a Dropdowns with options(1st column) & a Text field (2nd column).
Below that i have a Subform in which i have a another Dropdown which is blank with no option initially.
Now what I want is suppose user adds 4 rows in the table and from dropdown he selects suppose
1st row - Example 1 is selected
2nd row - Example 2 is selected
3rd row - Example 3 is selected
4th row - Example Other is select and in the text field column they write "MYNAME" (if other is selected then user has to fill the text field else text field i.e column 2 is blank)
now in dropdown in the subform (again repeatable) below which is blank initially should be populated with the above options :
so the dropdown should have option as follows:
Example 1
Example 2
Example 3
Example Other - MYNAME
Also, duplicates should be avoided and if the user deletes any row the same value should be deleted from the dropdown as well.
Thanks
@radzmar @BrianKasingli @ChitraMadan @dcidev
Solved! Go to Solution.
Views
Replies
Total Likes
This requires just an if-else statement.
var oRows = Table1.resolveNodes('Row2.[Cell1 ne " -Select-"]'); this.clearItems(); for (var i = 0; i < oRows.length; i += 1) { var oNode = oRows.item(i); if (oNode.Cell1.rawValue === " Example Other Member" ) { this.addItem(oNode.Cell2.rawValue); } else { this.addItem(oNode.Cell1.rawValue); } }
This is quite easy to realize. Add this JavaScript in the enter event of the RB dropdown.
var oRows = Table1.resolveNodes('Row2.[Cell1 ne " -Select-"]'); this.clearItems(); for (var i = 0; i < oRows.length; i += 1) { this.addItem(oRows.item(i).Cell1.rawValue); }
No, it's not working... i mean its working for only the 1st part .. ie. when you select options other than OTHER... when we select OTHER option the dropdown should be populated with the text field value.
This requires just an if-else statement.
var oRows = Table1.resolveNodes('Row2.[Cell1 ne " -Select-"]'); this.clearItems(); for (var i = 0; i < oRows.length; i += 1) { var oNode = oRows.item(i); if (oNode.Cell1.rawValue === " Example Other Member" ) { this.addItem(oNode.Cell2.rawValue); } else { this.addItem(oNode.Cell1.rawValue); } }
Thanks a lot . It is working ........