Giter Site home page Giter Site logo

Comments (4)

kflorence avatar kflorence commented on September 23, 2024

Yes, you can hook the wizard up to the form plugin to have it submit via AJAX. Branching based on AJAX calls is not currently supported, but it is a feature that can be added.

I'm still wrapping up the test suite and documentation for round 1 of this plugin, once that's finished I will see about adding asynchronous actions to the plugin.

from jquery-wizard.

kflorence avatar kflorence commented on September 23, 2024

Implemented in this commit: https://github.com/kflorence/jquery-ui-wizard/commit/2b0ad4f9b54b4c2d2231973a2c55928dd219338d

Have your action function return false and then later call the action method again with your response. For example:

someAction: function() {
    var self = this;

    $.ajax({
        ...
        success: function( response ) {
            self.select( response );
        }
    });

    return false;
}

from jquery-wizard.

kflorence avatar kflorence commented on September 23, 2024

It seems to fully integrate this feature, I will need to add event queuing -- I have created a branch for this and will complete the work there. It will be available upon merge into the master branch.

from jquery-wizard.

casey1701 avatar casey1701 commented on September 23, 2024

Quick question to follow up on this async. I know this is old, but I'm using it anyways. I have a wizard going with a couple of transitions. Here is my code. Based on the result of servicelookup, I would like to go to a specific step. This doesn't work. What should I do?

<script type="text/javascript">
				$("#wrapped").wizard({
					transitions: {
						choosetv: function( $step, action ) {
							var tvchoice1 = $step.find("[name=tv_choice]:checked").val();
							if(tvchoice1 == 'Starter TV - $45/mo'){ return 'additionaltv'; }
							if(tvchoice1 == 'Advanced TV - $110/mo'){ return 'additionaltv'; }
							if(tvchoice1 == 'No TV - $0.00'){ return 'end'; }
						},
						servicelookup: function( $step, action ) {
							var service_address=$("#service_address").val();
							$.ajax({
								type:'post',
									url:'check_service_address.php',
									data:{service_address: service_address},
									success:function(data){
										if(data == 'not_in_list\r\n'){ 
										console.log("sorry");
										return('sorry');
										}
										if(data == 'in_list\r\n'){ 
										console.log("congratulations"); 
										return('internet');
										}
									}
							});
							
						}
						
					}
				});
</script> 

from jquery-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.