Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question #51

Closed
casey1701 opened this issue Dec 12, 2019 · 5 comments
Closed

Question #51

casey1701 opened this issue Dec 12, 2019 · 5 comments

Comments

@casey1701
Copy link

Hey, I hate to make a new issue but I wanted to ask you a question. 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>

@casey1701
Copy link
Author

@casey1701
Copy link
Author

It throws the console.log's for sorry & congratulations correctly, but the returns don't work. I know its because that it is a different function, but I"m kind of at a loss how to get it back down to the right function. Is there a way to just directly go to a step and jump out of that success:

@kflorence
Copy link
Owner

Have you tried using the action method in your transition method? See #45 (comment)

@casey1701
Copy link
Author

casey1701 commented Dec 13, 2019 via email

@casey1701
Copy link
Author

casey1701 commented Dec 13, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants