Thanks for the code but I tried it and it still did not work.
$fields['states'] = array('type' => 'select2', 'data' => array('maximum-selection-length' => 2, 'maximum-input-length'=>3));
i tried that, the problem is that it wont just disable by adding the attribute disabled=yes or readonly= yes. they dont have effect on it.
secondly it is suppose to be a has_many hook so i am not sure i can do that with custom field
What other approach can i use to achieve this. i have tried to inserd the disabled= true and readonly = true, attribute to the multiselect using javascript but it did not work.
i want to disable selection once a user select a cirtain number of it…