I've got a somewhat irregular case: I need a user to fill in two values in a placeholder text. On the screen, there are a total of 4 placeholder texts. two of them are required, two of them are not. How do show which ones are required and which ones are not without compromising in design?
I have a couple of ideas.
One possibility is to embolden the placeholder text of the required ones. That may not be very intuitive but it should at least indicate that there is a difference and they may be able to then infer from the fields that those are required and the other aren't. Likewise, you could italicize optional fields.
Another is to add "(required)" after the placeholder text that is currently there. More straight-forward but possibly less "pleasing" depending on who you ask.
If inputs has border then You can play with border color for example required a bordered black and additional in gray color. Or use * sign for placeholder text and label
The most succinct - and generally most commonly used - way to distinguish a required field in forms is to use an asterisk next to the label (*). This way a user can easily distinguish which fields are required and which are not. So for example this pattern could look like:
[ input with placeholder/code hint text]
If you think this could potentially be confusing you could add a footnote at the bottom of the form explaining * = required but even on sites such as Smashing Mag, all they use is the symbol as it is very commonly used.
In cases where all the fields would be required perhaps the asterisk isn't completely necessary, but you'd have to make sure what information is present in these forms is obviously necessary in some way.