Your script is adding an event handler to the button if the select is changed to the first option. You should add the button event handler regardless, and make that check the dropdown value instead...
$(".button-hide").on("click" ,function() {
var val = $("#myselect").val();
if (val === "0") {
alertify.alert("You need to atleast select one plan !");
}
});