Misguided is right. I'll just add a little to it.
In saluting the flag those present in uniform should render the military salute. When not in uniform, men should remove the hat with the right hand and hold it at the left shoulder, the hand being over the heart. Women, and men without hats, should place the right hand over the heart. Aliens should stand at attention.
Dprice is right on, active duty military members are supposed to stand at the position of attention when not in uniform and salute when they are in uniform.
One other bit of info that I had heard before is that active military members are not supposed to recite the Pledge of Allegiance, you give your pledge when you raise your right hand to enlist. Might just be rumor, I have never been able to find this in writing.
36 UNITED STATES CODE, Section 172
TITLE 36 - PATRIOTIC SOCIETIES AND OBSERVANCES
CHAPTER 10 - PATRIOTIC CUSTOMS
The Pledge of Allegiance is not recited in military formations or ceremonies. At protocol functions, social, or sporting events which include civilian participants, military personnel should:
When in uniform, stand at attention, remain silent, face the flag and salute.
When in civilian attire, recite the pledge while standing at attention, facing the flag with the right hand over the heart. Men should remove headgear with the right hand and hold the right hand over the heart.