general handler function for events
work with checkbox
work with radio input