A General Principle for Intended Acts of Worship
A general rule [that applies to all acts of worship] is that any inadvertent doubts or confusion relating to the intention held when an act of worship was performed is ineffectual if it occurs after the action itself. Similarly, any doubts one may hold regarding an act of worship [will have no effect] after execution of the act regardless of whether that doubt occurs in the intention, or portions of the act of worship. One need only address the aspects of the act of worship that he has certainty regarding while everything else is considered ineffectual [to the validity of the act of worship].
An example of [a doubt relating to intention] is if a man, after having prayed ẓuhr, doubts himself saying: I don’t know if I intended this prayer as ẓuhr or ʿaṣr? This doubt is meaningless as long as he knew when he first started praying that it was ẓuhr, then it is ẓuhr. His doubts are meaningless after the occurrence of the act, as the poem says: “And doubts that occur after actions are ineffectual. Such is the case, for doubts are plentiful.”1 Likewise, if after someone prays, he begins to doubt whether he performed sujūd once or twice [which represents a doubt in an aspect of an act of worship]? This is also ineffectual.
Intending to Pray a Compulsory Prayer Without Specifying the Given Prayer
Here, there is an important issue which occurs quite frequently; if someone [enters into ṣalāh] with the intention of simply fulfilling the compulsory prayer of that time of the day without specifying the ṣalāh itself. For example, a person goes to pray ṣalāh al-ẓuhr and, upon finding the people praying, he begins praying with them at [ẓuhr] time. He does not think that this is ṣalāh al-ẓuhr, or fajr, or ʿaṣr, or maghrib or ʿishāʾ. He simply aims to fulfil that which is compulsory for that time of day.
According to the Ḥanbalī madh`hab, this intention is insufficient. This is because he must specify that the ṣalāh is either ẓuhr or ʿaṣr or maghrib or ʿishāʾ or fajr. There is another narration from Imām Aḥmad that if one intends to fulfil that which is compulsory for that time of the day, then this is sufficient. This narration is mentioned by Ibn Rajab in ‘Jāmiʿ al-ʿUlūm wa-al-Ḥikam’ and is the opinion taken by some of his [Imām Aḥmad’s] close companions.2 This [latter] opinion is the only one people will find ease in acting in accordance with as specifying the particular ṣalāh is frequently absent in the minds of most people. However, they hold the intention to fulfil that which is compulsory for that time of the day.
Distinguishing Between an Error Made in Action from One Made in Intention when Praying
Another issue: a man makes taslīm after two rakʿah thinking that he was praying fajr, then he remembered that it is ẓuhr time. Should he just pray another two rakʿah, or should he start over [and pray four]? They [the scholars] say: He should start over [and pray four]. This is because he made taslīm thinking that it was a two rakʿah prayer. This is different than a person who knew it was ẓuhr but forgetfully made salām after two rakʿah, then remembers [that he just prayed two]. This person may just [pray another two rakʿah] to complete four and then make sujūd al-sahw [the sujūd for forgetfulness]. This is because when he made taslīm [after the two rakʿah], he had intended to pray a four rakʿah prayer, [as opposed to the first person].
 See ‘Manẓūmah fī Uṣūl al-Fiqh wa Qawāʿid al-Fiqhiyyah’ by Shaykh ibn ʿUthaymīn (رحمه الله).
 See ‘Jāmiʿ al-ʿUlūm wa al-Ḥikam’ 1:85.
Source: Al-Sharḥ al-Mumtiʿ 1:206-208
Translated by: Riyāḍ al-Kanadī