First of all the Qur'an already tells us that the adversaries of Islam and Muhammed() would say that he is ill or ill-minded:
Say, "I only advise you of one [thing] - that you stand for Allah , [seeking truth] in pairs and individually, and then give thought." There is not in your companion any madness. He is only a warner to you before a severe punishment. (34:46)
Similarly, there came not to those before them any messenger except that they said, "A magician or a madman." (51:52)
And would Allah (God) send a revelation to a mad person or a person which suffers from epilepsy (who would forget anything which was revealed to her during a fit)?
And when a sign comes to them, they say, "Never will we believe until we are given like that which was given to the messengers of Allah ." Allah is most knowing of where He places His message. ... (6:124)
That's why a necessary condition for a prophet and an essential part in the Muslim 'Aqidah is that of a Prophet () being protected from any errors in the delivery of his message, and of course of a Propeht being able to fully deliver the message, baased on:
O Messenger, announce that which has been revealed to you from your Lord, and if you do not, then you have not conveyed His message. And Allah will protect you from the people. Indeed, Allah does not guide the disbelieving people. (5:67)
Another logical approach is that if he indeed suffered from epileptic fits his enemies would have done their best to prove it and use this against him -which they actually were unable to do-. But we have no historical report about such a case.
Usually a person who had an epileptic fit wouldn't recall what happened and the ahadith describe the "symptoms" of the epilepsy to happen at the time of a revelation, so how would he be able to recall what he has been revealed if he really had a fit?
After delivering some Islamic evidences, we need to say that even non-Muslims especially orientalists discussed this matter:
In "The Story of Civilization" by Will and Ariel Durant you may read in "IV. The Age of Faith (1950)" 1.Mohammed: 569–632 page 164 the following, aftere quoting the story of the first revelation or the first meeting between Muhammad() and Jibreel () (See here):
"Returning to Khadija, he informed her of the visions. We are told that she accepted them as a true revelation from heaven, and encouradged him to announce his mission.
Thereafter he had many similar visions. Often, when they came, he fell to the ground in a convulsion of swoon; perspiration coverd his brow; even the camel on which he was sitting felt the excitement, and moved fitfully.
Mohammed later attributed his gray hairs to tehse experiences. When pressed to describe the process of revelation, he answered that the entire text of the Koran exited in heaven, and that one fragement at a time was communicated to him, usually by Gabriel. Asked how he could remember these divibe discourses, he explained that the archangel made him repeat every word. Others who were near the Prophet at the time neither saw nor heard the angel. Possibly his convulsion were epileptic seizures; they were sometimes accompanied by a sound reported by him as like the ringing if a bell (*) -a frequent occurence in eplieptic fits. But we hear of no tongue biting, no loss of prehensile strength, such as usually occurs in epilepsy; nor does Muhammed's history show that degeneration of brain power which epilepsy generally brings on the contrary, he advanced in clarity of thought and in confident leadership and power until his sixtieth year. The evidence is inconclusive; at least it has no sufficed to convince any orthodox Mohammedan."
(*) see for example here in sahih al-Bukhari.
Even the non-Muslim authors seem to agree that important indications of an epilepsy are missing, and are also disporved by the history of our prophet () and its facts. This was also the conclusion of the German orientalist Max Meyerhof (Hildesheim 1874- Cairo 1945).
Finally Allah () told his prophet() not to care about what they say about him:
We know that you, [O Muhammad], are saddened by what they say. And indeed, they do not call you untruthful, but it is the verses of Allah that the wrongdoers reject. (6:33)
My major sources in Arabic islamweb and bayane al-Islam.