How can we Implement Captcha in Record producer ?

preddy
Kilo Guru

Hi Everyone,

My requirement is how we can implement to captcha in record producer?

1 ACCEPTED SOLUTION

Jeet
Tera Expert

Hi Pavan,



please follow below code to implement 3rd party captcha. Google has provided one api you can use that one.


Create one variable with type UI page in Record Producer form.


Below is UI page code that has to be picked on form side.


#Might be helpful for community people.



HTML Template :


<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


<script>https://www.google.com/recaptcha/api.js"></script>


<style>


table {


margin: 0 auto;


z-index: 1;


}


</style>


<g:ui_form onsubmit="validateform()"   >


<table   class="formTable table-bg font-style14"   >


<tr><td>


<div class="g-recaptcha" data-sitekey="6LeiwAYTAAAAAAscPMJuMno9Tbwt3KXqSEPmQhu2"></div>


</td>


</tr>


</table>


</g:ui_form>


<style>


.formTable {


margin-left: 20%;


}


.formTable tr td {


padding: 20px


}


</style>


</j:jelly>



Client script :


function validateform(){



  if(captcha_response.length == 0 ) {


            return false;


        }


        else{  


          return true;


        }


}




Thanks,


Jeet


View solution in original post

4 REPLIES 4

Alikutty A
Tera Sage

Hi Pavan,



This should help you out:   Including a Captcha on Catalog Items | Jeff Benedict



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


Jeet
Tera Expert

Hi Pavan,



please follow below code to implement 3rd party captcha. Google has provided one api you can use that one.


Create one variable with type UI page in Record Producer form.


Below is UI page code that has to be picked on form side.


#Might be helpful for community people.



HTML Template :


<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


<script>https://www.google.com/recaptcha/api.js"></script>


<style>


table {


margin: 0 auto;


z-index: 1;


}


</style>


<g:ui_form onsubmit="validateform()"   >


<table   class="formTable table-bg font-style14"   >


<tr><td>


<div class="g-recaptcha" data-sitekey="6LeiwAYTAAAAAAscPMJuMno9Tbwt3KXqSEPmQhu2"></div>


</td>


</tr>


</table>


</g:ui_form>


<style>


.formTable {


margin-left: 20%;


}


.formTable tr td {


padding: 20px


}


</style>


</j:jelly>



Client script :


function validateform(){



  if(captcha_response.length == 0 ) {


            return false;


        }


        else{  


          return true;


        }


}




Thanks,


Jeet


thank you,



your code is helpful for me...


TStark
Kilo Sage

NOT SUPPORTED.


I've spent hours trying to get this to work only to realize this solution uses Jelly which is not currently supported in the Service Portal.

 

Ref: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0756502

 

- AJ