0

I'm using jquery-steps in my shopping checkout page and it works fine but i am unable to use jquery to get elements inside the form to dynamically change the price based on the quantity.I cant anyone help?

i initialize the wizard by the code below but when i use other jquery code to like

$(".remove > div").click(function() {

it will not work

JS

<script>
        var form = $(".shopping-cart");
            form.children("div").steps({
                headerTag: ".header-tags",
                bodyTag: "section",
                transitionEffect: "fade",
                onStepChanging: function (event, currentIndex, newIndex) {
                  if (currentIndex > newIndex)
                    {
                        return true;
                    }
                    form.validate().settings.ignore = ":disabled,:hidden";
                    return form.valid();
                },
                onFinishing: function (event, currentIndex) {
                    form.validate().settings.ignore = ":disabled";
                    return form.valid();
                },
                onFinished: function (event, currentIndex) {
                    alert("Submitted!");
                }
            });

Natnael Getachew
  • 137
  • 1
  • 1
  • 9

2 Answers2

1

You can try this

$( ".shopping-cart" ).on( "click", ".remove > div", function() {
    // your code here
});
Paresh Maghodiya
  • 219
  • 2
  • 11
  • Hey thanks for your answer and i also faced another problem with jquery-steps i want to use dropzone.js for drag and drop but i am unable to use it inside the wizard can you help me on that? – Natnael Getachew Aug 24 '17 at 20:00
1

You should use form id instead of class. Instead of

var form = $(".shopping-cart");

use

var form = $("#your-shopping-cart-id");

Also documentation contains a lot useful examples;

Anna Adamchuk
  • 718
  • 4
  • 16