Input Field: Making field read-only

For instances where you still want people to be able to copy stuff (complex error messages comes to mind) but don’t want to overwrite it. Yes, I realize I can make script that constantly puts original value into the field, but Readonly checkbox would be a better solution.

This was done not to long ago. I dont think it made it for 5.2 though

It definitely isn’t in 5.1. If it’s in git, any idea on how to replace build-in UI components with git version?

Only thing I can think of right now that would be the easiest solution is just have somewhere that you would want to output the message to, lets say a rectangle on the UI, and have a Text object that will fill the same area as the rectangle object.

Make sure that you have overflow enabled, so that everything will stay inside the area that you specified.

When you want to output something like an error message, then just do something like:

public Text errorMessage;
errorMessage.text = somethingHere;

This will allow you to have a message appear that no one can edit, but they wouldnt be able to copy it. I cant really look much further into detail right now, but give some Google searches about used Unity 4.6 GUI with un-editable textAreas.

Yeah, I know about that and as I’ve said, I could make such script on my own, but checkbox in Input Field’s inspector would be better solution.

But thanks for effort :slight_smile: