Check out the link I gave above on "sneaky poo". Besides being helpful, it has a great story to read to the child about the whole process.
My son is 5.. he also goes in his pants. But its becsuse hes scared to go.. he had a large bowel movement a few months back and hes scared since. It is very frustrating.
Another poster just mentioned this down load. It is worth your time to check it out. The link is ...http://www.wch.sa.gov.au/services/az/divisions/paedm/genmedicine/documents/Sneaky_poo.pdf
Seems like this started when he started school? does he have this problem also over the summer or only during school?
Constipation can be a huge problem for little guys as it is painful, so they don't want to poop - until they have no choice. Is the poop in his underwear hard? thus showing constipation or kinda of runny?
But, if he eats a lot of salads and veggies, he should be getting enough fiber to help with that. A lot of fluids is also important.
One problem for him is that he is not getting enough protein, if salads and veggies is all he is eating. He needs meats, cheeses, nuts, beans etc. Or a supplemental protein drink.
and yes, it is all right for you to clean it up. The fact he is hiding it shows he is ashamed. He needs to get over that feeling. He might have some kind of a bowel problem, only a doc could tell you that. But more importantly I think is a docs opinion of his weight problem.
Anyway, if you can answer the questions on top of this post - I may be able to help more.