cancel
Showing results for 
Search instead for 
Did you mean: 

Add captcha in sapui5 application

Former Member
0 Kudos

Added captcha in sapui5 application but it is not working in ie

Accepted Solutions (1)

Accepted Solutions (1)

former_member182862
Active Contributor
0 Kudos

Hi Ashok

It is hard to support you when your question is brief.

When you elaborate more, understanding your question is going to be a breeze.

We hope to support as many members as possible.

But it is your willingness to provide more information that make this possible.

Providing snippet of your code would be nice.

Or working code in jsbin.com would be nicer.

We have many questions posted in this space.

Hence we are asking everyone to help so we can keep up with the pace.

Thanks

-D

0 Kudos

Hi Dennis,

I want to know how to implement CAPTCHA in my SAPUI5 Application.

Could you please help me with that?.

Thanks:

Azhar

Former Member
0 Kudos

hi azhar,

If you are using java script as view type then there are lot of javascript based plugins that are available which you can use in sapui5 application.

Regards,

Varun V

0 Kudos

Actually i am using .XML views, but my Controllers are off course .JS.

Hence kindly help me with some of the Links for the Javascript based CAPTCHA Plugins.

Thanks & Regards:

Azhar

Former Member
0 Kudos

You can refer the below code snippet for CAPTCHA. Written in JQuery.

function captcha()

  {

  var alpha = new Array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9');

  var alpha1 = new Array('1','2')//,'3','4','5','6','7','8','9');

  var random=new Array('1','2')

                  numericSumRandom = random[Math.floor(Math.random() * random.length)];

                      

  var a2,b2,j;    

                

                     

                      for (j=0;j<6;j++){

                         a2 = alpha1[Math.floor(Math.random() * alpha1.length)];

                       b2 = alpha1[Math.floor(Math.random() * alpha1.length)];

                      

                       }

                      code = a2;

                      code1=b2;

        

                     

                     

                     

                     

                     

                     

                     

                      var i;

         for (i=0;i<6;i++){

           var a = alpha[Math.floor(Math.random() * alpha.length)];

           var b = alpha[Math.floor(Math.random() * alpha.length)];

           var c = alpha[Math.floor(Math.random() * alpha.length)];

           var d = alpha[Math.floor(Math.random() * alpha.length)];

           var e = alpha[Math.floor(Math.random() * alpha.length)];

           var f = alpha[Math.floor(Math.random() * alpha.length)];

           var g = alpha[Math.floor(Math.random() * alpha.length)];

          }

        var code2 = a+b+c+d+e+f+g//a + ' ' + b + ' ' + ' ' + c + ' ' + d + ' ' + e + ' '+ f + ' ' + g;

       

       //

        if(numericSumRandom=='1')

        {

        if(document.getElementById("two")!=null)

        {

        document.getElementById("two").id="capta"

        }

       

        captcha.setPlaceholder("please enter the below letters");

       

        document.getElementById("capta").innerHTML = code2

        }

        if(numericSumRandom=='2')

        {

        if(document.getElementById("two")==null)

        {

        document.getElementById("capta").id ="two";

        }

        captcha.setPlaceholder("please add the below numbers");

        document.getElementById("two").innerHTML = "what is "+ code +"+"+ code1+" ?"

       

        }

       

  }

Former Member
0 Kudos

I used google re captcha refer bellow link to get captcha

https://www.google.com/recaptcha/intro/index.html

Answers (0)