Code Monkey home page Code Monkey logo

Comments (8)

jogaco avatar jogaco commented on May 19, 2024

I liked the wizard but didn't need the modal features, so I used it with a standard submit. One of my steps has a file upload.
I tweaked the implementation like this. Might not be the best one but worked:

var wizard = $('#my-wizard').wizard({ showCancel: true, progressBarCurrent: true });
wizard._defaultSubmit = function(wizard) {
  $('form').submit();
};
wizard.on("submit", wizard._defaultSubmit);

from bootstrap-application-wizard.

lgt avatar lgt commented on May 19, 2024

thank you for the feedback!! Actually what you suggest to override the default wizzard submit and is good like, however I was trying the following as you suggested

 wizard._defaultSubmit = function(wizard) {
            jQuery('form').submit(function( event ) {
                alert( "test submit" );
                event.preventDefault();
            });
        };
        
        wizard.on("submit", wizard._defaultSubmit);

and I expect to get an alert but is not happening. No errors in firebug are reported

from bootstrap-application-wizard.

jogaco avatar jogaco commented on May 19, 2024

You need to enclose your wizard within form tags with the corresponding url. It should work.
For instance, bearing in mind you want to upload files:

<form method="post" id="myform" enctype="multipart/form-data" action="/myaction">
   your wizard markup here
</form>

Let me know.

from bootstrap-application-wizard.

lgt avatar lgt commented on May 19, 2024

thanks again for your feedback. The wizzard has a form tag already this one should be changed? Is there a way to upload files via ajax on form submit?

from bootstrap-application-wizard.

jogaco avatar jogaco commented on May 19, 2024

I did comment out the

<form> 

tags in the bootstrap-wizard.js template code. Try it. As you need to do file upload your form must include the multipart encoding. As for ajax file upload, that's a different beast. I didn't need it so I opted for a simpler solution.

from bootstrap-application-wizard.

lgt avatar lgt commented on May 19, 2024

okay let me give a try this issue hangs on my neck almost for 1 week and thanks again for your nice feedback

from bootstrap-application-wizard.

jogaco avatar jogaco commented on May 19, 2024

I'd recommend you too to use bootstrap-fileupload.js from https://github.com/jasny/bootstrap/releases/tag/v2.3.0-p4 as it replaces the ugly file upload button with a nice bootstrap styled button, and offer the possibility of image preview in some browsers as well.

from bootstrap-application-wizard.

lgt avatar lgt commented on May 19, 2024

I made a switch from jasny to blueimp and I try now to use it for multiple file uploads with other form elements.

from bootstrap-application-wizard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.