Improved form panel onSave logic