Or perhaps—“That’s the email address we already have in our database. Do you want to change this, or would you like to stick with this one? If you’d like to change it, click this button. If you don’t want to change anything, click this other button …”
JS is very unreliable, in that users may have it turned off, or may not be able to access its messages. Modal boxes can also be very difficult in terms of accessibility. Imagine someone using a screen reader. While these do support JS, I’m not sure how well they understand messages appearing on screen—especially in a modal box that may be hard to navigate to. PHP is better in that you know it can’t be turned off, and in that it requires a page reload, which makes it easier to convey messages to everyone.
I am not going to use a modal box but I am going to use js(along with PHP)-to display simple messages aside the input boxes-like twitter does for example
Yep, pretty common, and it’s nice for those with eyes. I can be hard to alert non-sighted users to the fact that something has changed on the page, which is still a bit of a challenge at the moment. I gather some screen readers are better at handling this than others. The lesser ones take a snapshot of the page as it loads, and thus are unaware of any changes that happen after that.