updateMaterialSwitch function

Change the value of a materialSwitch input on the client