How to add script to onvaluechanged of toggle of a prefab on runtime?

Somehow … I can’t add the function of the script and its value to onvaluechanged of toggle on runtime.
Unity version is 2018.2.0f2

*The comment out part of the script also does not work.

Is there anyone who can help with this ??

I found a workaround and it is perfectly work!! Thank you Google!

public class BoardSelectSpecialScript : MonoBehaviour, IPointerDownHandler
    public int _id;

    public void OnPointerDown(PointerEventData eventData)

    //This function is same as mM.OnSelectBoard(id);
    public void BoardSelect()
        PlayerPrefs.SetInt("BOARD_ID", _id);