I am trying to learn JQuery to customise the way forms are displayed in SharePoint (in particular, to hide/show the options available in choice fields). I have managed to hide options/values within a dropdown list using the following code:
var dropdown = $(":input[title='Pets']");
dropdown.find('option:contains(Dog)').hide();
dropdown.find('option:contains(Cat)').hide();
I am stuck as to how to extend this to check boxes. So if I have a choice column (check box type) called "Pets" and check box options, "Dog", "Cat", and "Fish", but want to hide the "Dog" and "Cat" checkboxes (and of course the labels) from the form, allowing only "Fish" to be selected, how do I do this?
Would it also be possible to pre-select/check the "Fish" check box and disable/grey out?
Help would be really appreciated - have spent days trying to figure out what will clearly be basic for most users on this board. Thanks!