0

I have been trying to insert captcha tool at the checkout page before clicking the submit button. I placed the below code in checkout/confirm.tpl(not sure abt this either)......any ideas?...

    <div class="payment"><?php echo $payment; ?></div>

<script type="text/javascript">
var entry_captcha=<?php echo $entry_captcha; ?>;
var captcha =<?php echo $captcha; ?>;
var error_captcha='';
error_captcha =<?php echo $error_captcha; ?>;
var button_continue=<?php echo $button_continue; ?>


$( "#button-confirm" ).replaceWith( '<div class="form-group"> \
<span   class="required">*</span>   <b>"+entry_captcha+"</b><br /> \
    <input  class="form-control" type="text" name="captcha" value=""+captcha+"" /> \
    <br /><br /> \
    <img id="capim" style="align:right;" src="index.php?route=account/login/captcha" alt="" class="img-responsive img-captcha" /> \
<span class="form-group"><a id="capreload" >Click to refresh image</a></span> \
    <span class="error">Error</span> \  
</div> \
        <div class="buttons"> \
          <div class="right"> \
            <input id="button-confirm" type="submit" value=""+button_continue+"" class="button" /> \
          </div> \
        </div>' );
</script>
user614454
  • 123
  • 2
  • 13
  • First of all, javascript multiline strings needs a slash, read more [here](http://stackoverflow.com/questions/805107/creating-multiline-strings-in-javascript) –  May 28 '14 at 08:17
  • backslash you mean. And, don't start the html with a newline – konghou May 28 '14 at 08:30
  • you will need to add captcha init and validation on checkout controller too. – Dreanmer May 28 '14 at 13:58
  • I have seen dozens of thousands of requests for making the checkout process quicker and easier for customers... Now, one request to make it even worse and completely user **unfriendly** by adding CAPTCHA... Well, congrats. – shadyyx May 30 '14 at 07:22

0 Answers0