Using the name of gameObject to change a string in another script.

I have a bunch of input fields, with names corresponding to the names of strings, ints, floats, bools, etc. in another script. I am trying to use the name from the transform of these input field gameObjects to change the values of those strings, ints, etc. in another script.

e.g.,

public static string name1;

private void ChangeString()
{

           //Instead of doing it this way and making a new script for each input field 
           //because each affects a different string, int, bool, etc.
	PlayerLeader.lastName = newValue;
            //I want to do use something like this 

	name1 = gameObject.transform.name;
    PlayerLeader.name1 = newValue;
            //where i use a string set to the transform name to determine which
            //string, int, bool etc. I am accessing.

}

Ok i found topic about that Access variable by string name?

You must use GetComponent to access other components including scripts on other objects. You can read and write remote variables using this (highly documented) method.