Ignoring a form submit with Push.js and Ratchet

217 views Asked by At

I am using Ratchet for creating a mobile web page using ASP .NET MVC and I am loving it. I also love using push.js. However, I want to ignore a form submission and do a little extra content updating without the navigation. However, no matter what I put data-ignore="push" on it doesn't ignore the form submission.

What do I need to do to get it to ignore that form action?

Update:

Maybe I am just approaching this the wrong way and probably shouldn't be replacing content in a sub-section of the page for a mobile application. Does this break away from mobile centric design?

2

There are 2 answers

0
Jamie On

Pretty much closing this as I think that I am thinking of this in the wrong way. I should be thinking about it as a mobile application and not what I would do for a desktop based web app. Updating individual panels doesn't really make sense in the context.

0
clintgh On

assuming you use jquery library, you can do this:

$('form#{ID of the form}').on('submit', function(e) {
     e.preventDefault();
     //do your thing
});