Count and limit the length of any input passed with alert states.