how to validate input field if its null it gets color red in outline.

Hi everyone. im tring to validate a inputfield if it null onsubmit the inpu field outline will turns red

   if (playerInputName.text == "")
        {
           //what should i put in this line to get the input field outline turns red?
        }
        else
        {
            SceneManager.LoadScene("ScoreBoardGradetwo");
        }

The outline seems to be in the image itself, so yo must change the image. Also you’re checking if text is empty so your code does not work if it is null. Use IsNullOrEMpty instead.

        if (string.IsNullOrEmpty(playerInputName.text))
        {
            playerInputName.image = yourNewImageHere;
        }