onAfterResultAdd
Description and parameters
handler function( int WEB_FORM_ID, int RESULT_ID );Event handlers are called after adding new webform result. This can be used for any additional operations with webform result; for example for extra notificaitons using email. Handler is not designed to return any values. You can use CFormResult::SetField() for updating webform result fields.
Parameters
Parameter | Description |
---|---|
WEB_FORM_ID | Webform ID. |
RESULT_ID | Result ID. |
See Also
Handler function example
//handler must be registered in the file /bitrix/php_interface/init.php public static function my_onAfterResultAddUpdate($WEB_FORM_ID, $RESULT_ID) { // handler action applies only to the webform with ID=6 if ($WEB_FORM_ID == 6) { // write user IP address to the additional field 'user_ip' CFormResult::SetField($RESULT_ID, 'user_ip', $_SERVER["REMOTE_ADDR"]); } } // register function as a handler for two events AddEventHandler('form', 'onAfterResultAdd', 'my_onAfterResultAddUpdate'); AddEventHandler('form', 'onAfterResultUpdate', 'my_onAfterResultAddUpdate');
© «Bitrix24», 2001-2024