Your cookies go flat because either the fat I.E. butter or margarine is too soft or you are putting the dough on warm cookie sheets.
You could try chilling the dough until firm before baking. Always use cold cookie sheets.
tuttu415,your particially right.the butter in baking is soft so that it is incorporated into the sugars evenly, if it was hard the butter wouldn't mix in properly thus leaving little pieces of butter not blended into the sugars., some chocolate chip cookies will flatten out when baked,they do that automatically it the recipe. if you don't want flat cookies then look for a drop cookie that you like that doesn't flatten too much and add your chocolate chips to that batter, or dough, and Tutti is right about the cold cookie sheets ,putting dough on a hot cookie sheet will make them spread out,rather than staying a certain size.
Hope that clears up for you.
remember,STRESSED spelt backwards is "DESSERTS"
Our recipe specified shortening or margarine, but they're really not equivalent. With margarine or butter, the cookies came out with flattened edges every time. When I switched to Crisco, I got picture-perfect cookies.
Try beating it all by hand too, instead of using a power mixer. Overbeating can defeat the eggs' ability to link up and stiffen the final product.