Skip to content
Snippets Groups Projects
Commit 448db89e authored by Prasad's avatar Prasad
Browse files

Fixed captcha script support in webform

parent de70289c
No related branches found
No related tags found
No related merge requests found
......@@ -118,7 +118,8 @@
{/foreach}
</table>
{if $IS_CAPTCHA_ENABLED}
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
{# vscript - custom script tag to avoid loading when form popup is displayed #}
<vscript src="https://www.google.com/recaptcha/api.js" async defer></vscript>
<div class="g-recaptcha" data-sitekey="{$CAPTCHA_CONFIG['VTIGER_RECAPTCHA_PUBLIC_KEY']}" data-callback="enableSubmitBtn"></div>
{/if}
<input type="submit" value="Submit" ></input>
......
......@@ -48,6 +48,10 @@ Settings_Vtiger_Detail_Js('Settings_Webforms_Detail_Js', {
//show html without rendering
var allowedAllFilesSize = container.find('.allowedAllFilesSize').val();
var showFormContents = container.find('pre').html();
// Replace custom (vscript) tags to (script) before adding to textarea
showFormContents = showFormContents.replace(/vscript/g, "script");
showFormContents = showFormContents + '<script type="text/javascript">'+
'window.onload = function() { '+
'var N=navigator.appName, ua=navigator.userAgent, tem;'+
......@@ -175,4 +179,4 @@ Settings_Vtiger_Detail_Js('Settings_Webforms_Detail_Js', {
registerEvents : function() {
this._super();
}
})
\ No newline at end of file
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment