Why the Input Field script doesn't work??

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class textScript : MonoBehaviour {
	public InputField userInput; 
	
	void Start () { 
		userInput = GameObject.Find ("userInput").GetComponent<InputField>();
		userInput.onSubmit.AddListener (((value) => OnSubmit(value)));
		userInput.validation = InputField.Validation.Alphanumeric;	
	}
	void OnSubmit(string line) {
		Debug.Log ("OnSubmit("+line+")");
	}
}

I I followed the instructions in link text and in link text and couldn’t get my code work. I tried many different solutions but none of them worked. The problem is that Debug.Log don’t print anything. I’m using unity 4.6. Please help!!!

This link text solved the problem :wink: