added more functionality to the dynamicSelect.js

Added more code to the dynamic js functionality