UX: How do you update the value of one element from another?


To update an element’s value that has a data binding from another element’s value (or other elements’ values), for example, a paper-input, you can set the attribute on-change for the paper-input to a custom function. You can define the custom function to set the element’s value however you want, for example, copy or concatenation.

In the example code, I mimic the classic Employee form to update the full name by concatenating the first name and last name on change. The updated value will be reflected on the element. You can virtually apply this concept to other types of elements and with other types of events. The important point is that what you once needed a workflow for, can be replaced by a simple JavaScript function…

Continue reading

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s