Change Submit Button with jQuery / Javascript
  • FYI,

    I've used jquery to change the value of the submit button.
    But it seems lately my old code was not specific enough.

    This appears to work, just add other lines for other submit buttons like in the forms or blogs:

    $(document).ready(function()
    {
        $('input[type=submit].productAddToCart').val('Buy Now');
        $('input[type=submit].productDetailAddToCart').val('Buy Now');
        });
    ;
        </script>
  • 2 Comments sorted by
  • ckinteractive,

    Thanks for sharing this info with us.  I'm sure many will find this useful.
  • $("document").ready(function() {

    var addtocartButton = $('input.productDetailAddToCart, input.productAddToCart');
    if (addtocartButton.val() != '') {
    addtocartButton.val('bestellen');
    }
    var productDetailDescriptionTitle = $('H4.productDetailDescriptionTitle');
    if (productDetailDescriptionTitle.text() != '') {
    productDetailDescriptionTitle.text('Productbeschrijving');
    }
    var productDetailQuantity = $('span.productDetailQuantity label');
    if (productDetailQuantity.text() != '') {
    //console.log(productDetailQuantity.text());
    productDetailQuantity.text('Aantal');
    }
    var shoppingCartStatus = $('.shoppingCartStatus');
    if (shoppingCartStatus.html() != '') {
    shoppingCartStatus.html(shoppingCartStatus.html().replace('In Your Cart','Winkelwagen'));
    }
    });

Howdy, Stranger!

Login with Facebook

In this Discussion

Tagged

Copyright © 2014 LightCMS® Content Management System LightCMS is a product of NetSuite