Getting format exception error even though input field is int only

As the title says im getting the “FormatException: Input string was not in a correct format.” error but other solutions aren’t. I have the code connected to an input field to get a string when done editing, and the input field is integer only. I don’t understand how it’s even possible for me to enter it in a way it can’t format.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IQManager : MonoBehaviour
{
	//Declare Variables
    public static int IQ;
	public static int skilplus;

    public void getIQ(string s)
	{
			//update variables
			IQ = int.Parse(s);
		
			//check if elligible for bonus
			if (IQ > 15)
			{
				skilplus = IQ - 15;
			}
			
		//change text
		Debug.Log(IQ);
		Debug.Log(skilplus);
	}
}

Just in case, try printing out the string s and make sure it is an integer.

Secondly, you can try TryParse instead to deal with bad parses:

int.TryParse(value, out number)