Prayer is not valid except with intention.  There is a scholarly disagreement whether the intention is an integral component or a condition. The position of Hanafis, Hanbalis, and some Shafi`is is that it is a condition. Malikis and Shafi`is – according to the correct position of the school – posit that it is an integral. Consensus on this has been quoted by Ibn al-Mundhir, Ibn Qudamah, al-Nawawi (according to a large number of scholars), and Ibn Juzayy.