Save multiline form using a user button

Hi
I want to add a button that does some tasks, saves the data of the form (multiple records) and closes the app

The standard “save” button only saves the form, which is fine for me, but I would like to have another button.

I’ve tried using a php button that calls a javascript function containing:
nm_atualiza(‘alterar’);
return false;

but it doesn’t work.
any suggestions?
thanks and regards