Loss of vision in both eyes for a second happened twice had headache in temples at the time have had catarac s removed 5 years ago?

Ocular migraines. Your episodes are pretty brief, but ocular or eye migraines can occur in both eyes at once. Tia (mini stroke) can also do this, so see your medical doctor!
See eye doc. See eye doc for full exam. It is odd that it happened in both eyes at the same time. It may indicate a problem in the part of the brain that interprets vision such as a tia/stroke.