[Vuejs]-Multiple Google Recaptcha with VueJS

0👍

Figured this out, did not know that the render function returned the widget ID. grecaptcha.execute() will just execute the first widget in the global list if not given an optional widget ID parameter.

To tackle this, assign the widget ID returned by the render function to a data property in the component and then within the validate function, call execute with that widget ID as the parameter.

self.widgetId = grecaptcha.render(self.name, {...});

validate: function ()
{
    grecaptcha.execute(this.widgetId);
},

Leave a comment