You must Sign In to post a response.
  • Category: HTML

    How to draw captcha in HTML page through javascript

    Hi all,

    Please help me, How to draw captcha in HTML page through javascript.
    If possible, send me the code.
  • #753656
    You can use this code to draw captcha in HTML page through javascript


    <script type="text/javascript">
    //Created captcha
    function DrawCaptcha()
    {
    var x = Math.ceil(Math.random() * 10)+ '';
    var y = Math.ceil(Math.random() * 10)+ '';
    var z = Math.ceil(Math.random() * 10)+ '';

    var code = x + ' ' + y + ' ' + ' ' + z ;
    document.getElementById("tCaptcha").value = code
    }

    // generated security
    function ValidCaptcha(){
    var string1 = removeSpaces(document.getElementById('tCaptcha').value);
    var string2 = removeSpaces(document.getElementById('tInput').value);
    if (string1 == string2) return true;
    return false;

    }

    For detail information you can use given URL

    codeproject.com/Articles/42842/Implementation-of-Captcha-in-Javascript

  • #753719
    You can try the below code for having a google captcha in the page.



    function showRecaptcha(element)
    {
    Recaptcha.create(
    "http://www.google.com/recaptcha/api/js/recaptcha_ajax.js",
    element,
    {
    lang: "<%=LanguageCode %>",
    theme: "red"
    //callback: Recaptcha.focus_response_field
    });
    }

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM


  • Sign In to post your comments