if # submit button press do the rest else #submit button not pressed don't do the rest