+ Start a Discussion

Alert for wrong password.

Hi, I have a Visualforce sign in page , how do I give alert when wrong password is entered. Thanks
PriyaPriya (Salesforce Developers) 

Hi Ashy,

Kindly refer this article, it has got the entire project :- 

Github link :- https://github.com/salesforceidentity/basic-custom-login

Please mark it as best answer if you find the above information helpful.

Priya Ranjan 

Boddh Prakash 38Boddh Prakash 38
Hi Ashy,
  • I would like to suggest one solution if you already know about the correct password then you can simple put a validation on visualforce page UI and you can display any message to the actual user.
  • If you don't have any idea about the user password then you can simply check their last login history using below query.
  • First, you need to enable the event monitoring. 
User-added image
  • Select Id, Status, CreatedDate, LoginType from LoginEvent
  • Using above query , you would be able to check user login status where you can simply checj whether the actual user is having login status success with right password or failure with wrong password.

Suraj Tripathi 47Suraj Tripathi 47
Hi Ashy,

you can set an alert for the wrong password by using  
 ApexPages.message(your field,'your message')

To see the complete example follow the below link.


If you find your Solution then mark this as the best answer.

Thank you!

Suraj Tripathi  
michle Kmichle K
Icloud s safe but may be it's difficult for the Android devices. Anyone can correct me. Thanks
michle Kmichle K
Suraj shared a link, you can check that.
simply buzzes 9simply buzzes 9
Hi, Michle thanks for your link i have checked it but there are few 404 issues that i have found with your site please have a look here  ( to check the all Error in detail. Many Thanks
Anand kurubaAnand kuruba
The alert for wrong password 
please follow below link