Expand my Community achievements bar.

Get binding value trough JavaScript

Avatar

Level 3

Hello,

Simple question, hopefully has a simple answer! I have a drop down list with three values that are bound.  The text to these bindings change, so what I am looking for is what the javascript is to be able to get the binding for the selected item.  For instance, if I were to get the text for the item, I would use this.rawValue;, but what do I use to get the binding?

Thanks

3 Replies

Avatar

Former Community Member

In the same manner you would use this.rawValue, you can use this.bind.ref to get the binding

Avatar

Level 3

This is giving me the default binding (in the case of this drop-down list, which is connected to an XML Schema, it is giving me $.rate).  What I am looking for is the binding value for the text that is currently selected.  Is this possible?

Avatar

Level 10

I think fieldName.boundItem() will do what you're after.

It depends on what you're trying to do really.

I've used it on DDLs for activating other things (hiding subforms, changing values, etc.) with something like var newValue = this.boundItem(xfa.event.newText).