I had this exact same issue occurring. I went into my iphone settings and went to "general", scroll down to "reset", and then choose the option to "reset network settings". Your iphone will then reboot. Then I went back into my wifi settings, entered my wifi password and everything worked fine! For some reason the iphone can get messed up over time so resetting the network and re-entering fixed it for me. :)
Make sure you are choosing the right option in there and dont choose the other erase options!