sammy
sammy copied to clipboard
Sammy post route not capturing javascript form submits?
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
Check whether your form is inside of main sammy.js element
Yes, it's in the element.
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 :)
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()).
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