Storing Inputfeilds

Hi I currently have this function below and have attached it through the inspector to the input feild but it does not display the varible out to the console, can anyone help?
public void GetInput(string name)
Debug.Log (“Your Nickname” + name);
inputNickname.text = “”;

Thanks for the reply, realised I had to set the function as Dynamic instead of static when selecting it in the inspector.