I fixed it by doing this:

if al_button = 88 then
commit_form;
end if;

The 88 came from the value of al_button when I pressed the OK on the alert in debug mode. A little crude, but it works.