#select #widget #designer #form

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;`