how to clear value of widget while change option of select


I have a select-widget that it depends on value of another select-widget. I wrote a js variable that clear value of slave widget and call it in changing of master widget, but it always clear value of slave widget. I just want to clear previous value .
how can clear previous value of slave widget when master widget is changing?

js variable: onSelectLab
$data.selectedlabType = null;


return true;`


Submitted by antoine.mottier on Wed, 01/16/2019 - 10:09

1 - To make sure I understand correctly: your use case is for example to have a master list that store list of USA states and a slave list that store cities of the selected state. Is that correct ?

2 - Also can you confirm that your successfully managed to update cities list when user select a different state?

3 - And finally could you confirm that your current issue is that when user select again the same state as currently select the slave list is update and selection reset but it should not actually modified at all the slave list?


Submitted by nasrin788_1384620 on Fri, 01/18/2019 - 19:03

1- Yes, my depended list is like states and their cities.
2- Yes, when state is changed, cities is get from bdm using external API
3- when user changed state, list of it's cities get from dbm and it works correct, but previous selected cities remains in input. I just want to clear of input that user is forced to select city of current state.

No answers yet.