The dreams of the Prophets عليهم الصلاة والسلام were all true - which was a valuable support to the veracity of their message. Whether they were sleeping or awake, Shaytaan was not allowed to make them envision falsehood.
Sa'eed Ibn Jubayr رحمه الله reported that Ibn 'Abbaas رضي الله عنهما said: "The Prophets' dreams are part of revelation." 
Imaam Ahmad رحمه الله said: "The dreams of the Prophets عليهم الصلاة والسلام were part of revelation. Only ignorant individuals would belittle dreams and claim that they have no consequence." 
Dreams are, therefore, included in the meaning of the aayah:
When a person has a bad or alarming dream, he is urged to take the following actions:
(1) Seek Allaah's سبحانه و تعالى protection from its evil.
(2) Seek Allaah's سبحانه و تعالى protection from Shaytaan.
(3) Lightly spit, three times, to the left side.
(4) Turn over and sleep on a different side.
A good dream is a favour from Allaah سبحانه و تعالى because it is granted by Him. It carries glad tidings, brings happiness to the heart, and is an indication of a believer's truthfulness and righteousness. These are important reasons to praise Allaah سبحانه و تعالى for it.
In addition, a good dream should be narrated to learned people who care for the dreamer and wish good for him, so as to give him a good interpretation for it.
On the other hand, he should not narrate it to individuals about whom he may have some misgivings. Such people might become envious, belittle his dream, and even try to misinterpret it in order to cause him dismay.
Imaam al-Baghawi رحمه الله said: "A dreamer should only relate a pleasant dream to a person whom he likes (i.e. trusts). If, instead, he relates it to someone whom he dislikes, that person may misinterpret it for him out of envy, causing him some distress. He may also try to plot against him, Allaah سبحانه و تعالى described Ya'qoob's عليه السلام concern regarding his sons' plotting, should Yoosuf عليه السلام have related his dream to them."  
Therefore, upon having a good or pleasant dream, a person is urged to take the following actions:
Abu Salamah  رحمه الله reported that he used to have dreams that made him ill (from fear or worry) - until he heard Abu Qatadah رضي الله عنه mention that he had the same problem, so Allaah's Messenger صلى الله عليه وسلم told him: "A pleasant (or good, or truthful) dream is from Allaah, and a bad dream is from Shaytaan. When one of you has a good dream (that he likes), let him expect good, and avoid relating it except to those whom he loves. And when he has a dream and dislikes any part of it, let him seek Allaah's protection from its evil and from Shaytaan's evil, and let him lightly spit - three times - on his left side, and avoid relating it to anyone. Indeed, it will then not harm him." 
Abu Sa'eed al-Khudri رضي الله عنه reported that he heard the Prophet صلى الله عليه وسلم say: "When one of you has a dream that he likes - indeed, it is only from Allaah, so let him praise Allaah for it and relate it (to his beloved ones). And if one of you has a dream that he hates - indeed, it is only from Shaytaan, so let him seek Allaah's protection from its evil, and let him not mention it to anyone: it will then not harm him." 
Abu Hurayrah رضي الله عنه reported that the Prophet صلى الله عليه وسلم said: "Dreams are of three categories: a good dream that has glad tidings from Allaah, a terrifying dream from Shaytaan, and a dream about what concerns a person. When one of you has a dream that he dislikes, let him rise from his sleep and pray, and let him not relate it to other people." 
Bad and terrifying dreams are attributed to Shaytaan because:
(1) He initiates the bad and hateful thoughts and insinuates them into people's thoughts in dream form.
(2) He likes and approves bad dreams and evil thoughts.
Allaah's سبحانه و تعالى creation is all good, and is of great underlying wisdom and benefit. However, the goodness and wisdom behind what appears to be evil may not be perceived by many people.
Whereas texts of the Qur'aan and Sunnah attribute good and honourable actions directly to Allaah سبحانه و تعالى, they often do not directly attribute to Him actions or things that are apparently evil. This is done out of respect and reverence for Him. The same rule applies to dreams: attributing good dreams directly to Allaah سبحانه و تعالى is a common practise in the Sunnah, whereas bad dreams are attributed to Shaytaan - though he does not create them.
Dreams are among the spiritual puzzles of this life. People have conflicting and confusing views regarding their nature. Only by adhering to the guidance of the Qur'aan and Sunnah can we form a reasonanble understanding of dreams.
Imaam al-Maaziri رحمه الله said: "People have numerous arguments regarding the nature of dreams. As for those who not adopt a religious understanding, their arguments are particularly outrageous. They tackle issues that cannot be reached with the human reason, and for which there is no proof; and since they do not believe in the Revelation, their statements are widely conflicting." 
Imaam al-Qurtubi رحمه الله said: "The reason for the confusion of non-religious people in regard to dreams is that they turn away from the Straight Path of the Prophets عليهم الصلاة والسلام. What we say is that dreams are reflections of the soul; and since we cannot comprehend the soul, we would not, obviously, comprehend its reflections..." 
We establish below that dreams are visions that Allaah سبحانه و تعالى creates and instills into our hearts.
Some dreams, truthful and sublime, are granted by Allaah سبحانه و تعالى. They support and reassure a believer, warn him of some individuals, reprimand him for some of his wrongdoings, foretell him of some good (to anticipate) or harm (to beware of), and so on. Such dreams are attributed to Allaah سبحانه و تعالى because of the truth and good they carry.
A dream is a vision that a person sees during his sleep. The Arabic words for dream are ru'yaa (pl. ru'aa) and ḥulum (or ḥilm, pl. aḥlaam).
In the Qur'aan, the word ḥulum appears three times  - each time referring to mixed-up dreams, and the word ru'yaa appears seven times  - each time referring to truthful dreams.
In the Sunnah, "ru'yaa" and "ḥulum" are sometimes used interchangeably. More often, however, ru'yaa is used for a good dream and ḥulum for a bad one.
The companions رضي الله عنهم of the Messenger of Allaah صلى الله عليه وسلم and those who came after them and followed their way, Ahlus-Sunnah wal-Jamaa'ah, are agreed that 'Uthmaan Ibn 'Affaan رضي الله عنه was the most qualified of people to become caliph after 'Umar ibn al-Khattaab رضي الله عنه, and no one objected or disagreed with that. Rather they all submitted to that because he was the best of Allaah's creation after the two Shaykhs, Abu Bakr رضي الله عنه and 'Umar رضي الله عنه, and a number of scholars of hadeeth and others narrated that there was consensus on the legitimacy of 'Uthmaan's caliphate after 'Umar رضي الله عنه. These reports include the following :
(1) - The report of Ibn Abi Shaybah رحمه الله with his isnaad going back to Haarith ibn Mudarrib رحمه الله who said: "I performed Hajj during the caliphate of 'Umar رضي الله عنه and they did not doubt that the caliphate would pass to 'Uthmaan رضي الله عنه after him." 
(2) - Abu Na'eem al-Asbahaani رحمه الله narrated with his isnaad going back to Hudhayfah رضي الله عنه that he said: "I was standing with 'Umar رضي الله عنه, my knee touching his knee, and he said: 'Who do you think the people will appoint?' I said: 'The people have already decided on Ibn 'Affaan.'" 
(3) - Al-Haafidh adh-Dhahabi رحمه الله narrated that Shareek ibn 'Abdillaah al-Qaadi رحمه الله said: "The Prophet صلى الله عليه وسلم died and the Muslims appointed Abu Bakr رضي الله عنه as his successor; if they had known that there was anyone better than him among them, then they would have deceived (the ummah, by doing that). Then Abu Bakr رضي الله عنه appointed 'Umar رضي الله عنه as his successor and was a man of truth and justice. When he was dying, he delegated the matter (of succession) to a council of six men, who agreed on 'Uthmaan رضي الله عنه. If they had known that there was anyone better than him among them, then they would have deceived us." 
All these reports clearly indicate that it was well established among the companions of the Prophet @ that 'Uthmaan رضي الله عنه was more qualfied to succeed to the caliphate when 'Umar ibn al Khattaab رضي الله عنه was still alive, because they already knew and had learned from the texts which spoke of his position in the order (of caliphs) that he would become caliph after 'Umar رضي الله عنه, and because they knew that he was the best of all the people after Abu Bakr and 'Umar (may Allaah be pleased with them both).