Added onchange event handler, rework show/hidden workflow