puts condition based on actions (button names submit and update)