There are various factors which can cause fainting during air travel like High altitude,Low blood pressure,Dehydration,Hypoglycemia.
Changing position from sitting to standing is too fast for blood to reach your brain at high altitude causing fainting.
Usually it's good to maintain proper hydration.
leg stretching exercises during air travel can be helpful.
Also eat small meals through out the travel.
Gradually change the position.
Avoid alcohol consumption in flight.
If possible keep Oral rehydration solution along with in your bag.
Monitor your blood pressure.
If it persists a clinical exam by family doctor should be considered.
Feel free for further queries. It's good to discuss rather than quit.
Your satisfaction is our goal.