Question by
txcrnr · Jan 11, 2018 at 04:03 AM ·
inputfield
Cannot clear text from inputfield
Hello. I am trying to clear the text from an inputfield. I can access the text just fine, but when I try to set it back to its placeholder by clearing the text with InputField.text = "" or InputText.gameObject.GetComponent().text = "" nothing happens.
Comment
Answer by lspence812 · Jan 15, 2018 at 03:19 PM
Try selecting it first and then clearing it.
public InputFiled myInputField;
myInputField.Select();
myInputField.text = "";