All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
It is recommended for the Muslim to dress in his best garment when performing the prayer in compliance with the divine command in the verse: {O children of Aadam (Adam), take your adornment at every masjid.} [Quran 7:31] However, it is permissible to perform the prayer in whatever clothes he has as long as they are pure and properly conceal the ʻAwrah.
It is known that according to the view of the majority of scholars the ʻAwrah of the man is the area between the navel and the knee. The navel and the knee are not part of the ʻAwrah. If a Muslim man performs the prayer while his knees or parts of them or the navel are exposed, then the prayer is valid, but such exposure is disliked.
Ibn Qudaamah wrote:
“It is sufficient for the Muslim man to cover the area from the navel to the knees in terms of clearing himself of his liability from the obligation of covering the ʻAwrah during the prayer. In brief, covering the ʻAwrah with non-transparent clothes that do not show the skin color underneath them is one of the obligations and conditions of the validity of the prayer ... the navel and knees are not part of the ʻAwrah, as was stated by Imaam Ahmad in different occasions. This was also the view of Maalik and Ash-Shaafiʻi.” [Al-Mughni]
The Shaafiʻi book Iʻaanat At-Taalibeen reads, “It is disliked for the Muslim man to reveal his knees because this may lead to the exposure of the ʻAwrah.”
Hence, if these shorts conceal the area from the navel to the knees, then there is no harm in performing prayer while wearing them even if they do not cover the navel and the knees because they are not part of the ʻAwrah, as stated above. However, if they do not properly cover what is between the navel and the knees such that parts of that area are uncovered during the prayer while performing Rukoo' (bowing) or in any other act of the prayer, then his prayer is invalid because of the exposure of the ʻAwrah since concealing the ʻAwrah is one of the conditions to the validity of the prayer.
An important point needs to be underlined in this regard; according to most scholars, the uncovering of the ʻAwrah during the prayer does not invalidate it in all cases. The scholars who hold this view believe that if a significant part of the ʻAwrah was uncovered during the prayer and the person immediately concealed it, there is no harm in that. Also, if an insignificant part of the ʻAwrah was uncovered and the person was not aware of the exposure during the prayer, then there is no harm in that as well. But if an insignificant part of the ʻAwrah was uncovered during the prayer and the person was aware of it but did not cover it immediately, then he is obliged to repeat the prayer.
Ibn Qudaamah wrote, “Slight exposure of the ʻAwrah during the prayer does not invalidate it, as was stated by Ahmad. Abu Haneefah also held this scholarly view. Ash-Shaafiʻi said, 'The prayer is invalidated by the slight exposure of the ʻAwrah during the prayer because the validity of the prayer in this case is related to the ʻAwrah; slight and major exposure of the ʻAwrah are alike in this regard such as the case with looking (at the 'Awrah).’”
Kashshaaf Al-Qinaaʻ ʻala matn Al-Iqnaaʻ reads:
“The prayer is not invalidated by the exposure of a significant part of the ʻAwrah (by wind or the like) for a slight interval of time, even if the whole 'Awrah was exposed, as long as it was covered quickly without much movement. However, if the praying person needed to move a lot to cover the ʻAwrah, then the prayer is invalidated. If the praying person deliberately uncovers a slight part of the ʻAwrah, then the prayer is invalidated because this can be easily avoided without incurring undue hardship, similar to the rest of the ʻAwrah. The prayer is also invalidated if a large part of the 'Awrah was exposed for a long period of time, even if unintentionally...”
Allaah knows best.