JS magic_form implementation