Set Value and then Save

I want to use the Submit button to set a value then save but I can’t seem to get this to work. I tried using the beforeSave() feature but that came back as not a function
when I try putting in the below in the on click I get cannot set property “value” of undefined. Please help.
fd.field(‘Status’).value = ‘Sent To HR’;;

Dear Jennifer,
Are you talking about SharePoint Forms? In that case, please, try the following code:

fd.spBeforeSave(function() {
    fd.field('Status').value = 'Sent To HR';

I am refering to Plumsail forms and this did not work. I put it in the Java Script area at the top of the form.
Do I need to put it in the OnClick feature?

Dear Jennifer,
I understand that we are talking about Plumsail Forms, but are you working with SharePoint Modern UI or Public Web Forms? The code does need to go in the JavaScript editor.

Wait a second, let me check it for you, there seems to be some issue with quotes. Please, try to replace the quotes in the code with your own ’ ones, they do not seem to be copied correctly.

P.S. I’ve tried to fix the quotes, please, copy the code once again and make sure that both ‘Status’ and ‘Sent to HR’ are highlighted in red in the JS editor: