Receiving error "ReferenceError: 'func' is not defined:" after adding Catalog Client Script

Brian155
Mega Expert

We have a computer replacement request with the requirement that the fulfiller must check a box on a specific task (multiple choice field hidden on the REQ named “need_computer”).  The task goes to a dispatch group who will reassign the task to a technician so it can’t be required unless the task is attempting to be closed. 

I used the answer here:

https://community.servicenow.com/community?id=community_question&sys_id=9622036ddb98dbc01dcaf3231f96...

and added this Catalog Client Script:

function onSubmit() {
//Type appropriate comment here, and begin script below
var ritm= g_form.getReferenec("request_item");
if((g_form.getValue('state')==3) && (ritm.cat_item=='3d131f3fdbec73004c1cd92b5e961928')){
if(g_form.getValue('variables.need_computer')==''){
g_form.setMandatory('variables.need_computer',true);
return false;
}
} 
}

find_real_file.png  

However, I get this error when I attempt to close the task regardless if I select an option in “need_computer” or not:

Error MessageonSubmit script error: ReferenceError: 'func' is not defined:
function () {
saveAllSelected([ gel(id) ], [ gel(ref) ], ',', '\\', '--None--');
}

find_real_file.png

Appreciate any help.