I had this issue with my kids. I found out much later that my kids had a gluten and casein "sensitivity"--which is actually an allergy. We have 5 different types...anyways--I would have them do a test to find out if your child has these sensitivities. It is a blood test, and many insurance companies will pay for it.
Even if they do not, it is worth it in the end! Not only can you child get dehydrated, but these sensitivities or delayed allergies can cause some really great internal damage that many people do not realize is happening. This can cause other issues down the road, as well.
I would have your child tested. I wish I had my second tested sooner, before the internal damage was done..I was glad I had my last tested, because we avoided a lot of heartache--and was able to set him on a path that helped his body accept these foods, and now he can eat almost anything in regulation....