Tuesday, 15 April 2014

jquery - Stop action propagation within a form using Jquerymobile, Knockout.js? -



jquery - Stop action propagation within a form using Jquerymobile, Knockout.js? -

so, have issue performing 2 actions @ same time. 1 of actions ajax phone call consumes webservice , stuff save info on server, other action homecoming view there's list.

my code follows href doesn't perform binding submit. told want need "stop propagation of action" don't know how. mind giving me tips? here's code:

<form data-bind="submit: updatedata" method="post" data-ajax="false"> <div data-role="content" data-theme="d"> <center> <h2> save changes? </h2> <input type="submit" name:"submit" data-inline="true"> </center> </div> </form>

this question based upon 1 -> how perform knockout.js action before next <href>? doing in different way before changed form. however, none of these worked out me.

you can this

<form data-bind="submit: updatedata" method="post" data-ajax="false"> <div data-role="content" data-theme="d"> <center> <h2> save changes? </h2> <input type="submit" name:"submit" data-inline="true"> </center> </div> </form> self.updatedata = function(){ if(self.ajaxrequest()){ //do other action // $('some id').trigger('click'); } } self.ajaxrequest = function(){ var status = false $.jax({ ..., success : function(){ status = true } }) homecoming status }

jquery html5 knockout.js form-submit stoppropagation

No comments:

Post a Comment