Check if InputField is empty

How do you check if the input field is empty? I got an error when deleting the whole text in the InputField. The input field content is set to decimal numbers only.

You simply need to examine the text value of the input field to see if it is blank…

if(inputField.text=="")
  Debug.Log("field is empty");

http://docs.unity3d.com/ScriptReference/UI.InputField-text.html

Years late update: Regarding checking a string in general… Hellium has a better/more complete/bulletproof way to check them in the comments below:

string.IsNullOrEmpty( inputField.text )

hey guys,how to use it on gui lable with if statement;thank you
,how to show with gui label