public function displaySubmit($formIdentifier, $text = 'submit', $attributes = [])
    {
        $javascript = '';
        if (!isset($attributes['data-callback'])) {
            $functionName = 'onSubmit' . str_replace(['-', '=', '\'', '"', '<', '>', '`'], '', $formIdentifier);
            $attributes['data-callback'] = $functionName;
            $javascript = sprintf(
                '<script>function %s(){document.getElementById("%s").submit();}</script>',
                $functionName,
                $formIdentifier
            );
        }

        $attributes = $this->prepareAttributes($attributes);

        $button = sprintf('<button%s><span>%s</span></button>', $this->buildAttributes($attributes), $text);

        return $button . $javascript;
    }
public function displaySubmit($formIdentifier, $text = 'submit', $attributes = [])
    {
        $javascript = '';
        if (!isset($attributes['data-callback'])) {
            $functionName = 'onSubmit' . str_replace(['-', '=', '\'', '"', '<', '>', '`'], '', $formIdentifier);
            $attributes['data-callback'] = $functionName;
            $javascript = sprintf(
                '<script>function %s(){document.getElementById("%s").submit();}</script>',
                $functionName,
                $formIdentifier
            );
        }

        $attributes = $this->prepareAttributes($attributes);

        $button = sprintf('<button%s><span>%s</span></button>', $this->buildAttributes($attributes), $text);

        return $button . $javascript;
    }
public function displaySubmit ( $ formIdentifier , $ text = 'submit' , $ attributes = [ ] ) { $ javascript = '' ; if ( ! isset ( $ attributes [ 'data-callback' ] ) ) { $ functionName = 'onSubmit' . str_replace ( [ '-' , '=' , '\'' , '"' , '<' , '>' , '`' ] , '' , $ formIdentifier ) ; $ attributes [ 'data-callback' ] = $ functionName ; $ javascript = sprintf ( '<script>function %s(){document.getElementById("%s").submit();}</script>' , $ functionName , $ formIdentifier ) ; } $ attributes = $ this -> prepareAttributes ( $ attributes ) ; $ button = sprintf ( '<button%s><span>%s</span></button>' , $ this -> buildAttributes ( $ attributes ) , $ text ) ; return $ button . $ javascript ; }
Display a Invisible reCAPTCHA by embedding a callback into a form submit button.

@param string $formIdentifier the html ID of the form that should be submitted.
@param string $text the text inside the form button
@param array $attributes array of additional html elements

@return string
Display a Invisible reCAPTCHA by embedding a callback into a form submit button .