sammy icon indicating copy to clipboard operation
sammy copied to clipboard

Sammy post route not capturing javascript form submits?

Open motord opened this issue 13 years ago • 5 comments

When I try to capture the form post initiated by a hyperlink click, Sammy failed to match the route:

<form action="#/post" method="post">
    <a href="#" onclick="this.parentNode.submit(); return false;">foo</a>
</form>

Is it Sammy can only capture posts via form submit button?

Thanks

motord avatar Sep 07 '11 18:09 motord

Check whether your form is inside of main sammy.js element

alionaya avatar Sep 12 '11 07:09 alionaya

Yes, it's in the element.

motord avatar Sep 18 '11 17:09 motord

motord, can't say I've seen the problem but why aren't you using jquery and binds in order to handle your events? Sammy is built on jQuery, may as well use it :)

kirkbushell avatar Oct 20 '11 21:10 kirkbushell

I'm having this issue, too. Having to manually build parameters and call runRoute. I don't want to add a submit button as I'm using a jqueryui dialog to house the form (with a button that calls .submit()).

vilmibm avatar Mar 26 '12 17:03 vilmibm

From what I can see this is not a sammy problem. The following post should be related to the original problem: http://stackoverflow.com/questions/1692908/jquery-submit-problem

endor avatar Jun 17 '12 15:06 endor