What would you suggest besides closest? The form on the regular checkout has no id or anything to refer to specifically. It was the best way to get the submitting form into a variable in the javascript code.
closest also stops when it finds a match, as opposed to the parents method which will traverse the whole tree and then filter the results.
regardless, I don't think my using closest is causing nopcommerce to strip javascript out of the page :)
When you say it strips off, are you viewing through View Source or the Developer Tool (sounds stupid but just to make sure)? I can't think of a reason why it strips off JS yet, probably due to AJAX? (Need to think harder, might have missed something!)
You can just select 2 sets of form differently. One by #co-payment-info-form and another by .payment-info form.
And just to make sure the original onclick event is not overriding anything, perhaps you can overtake it, and call PaymentInfo.save() inside your very own method? http://stackoverflow.com/questions/2629916/how-do-you-override-inline-onclick-event
closest also stops when it finds a match, as opposed to the parents method which will traverse the whole tree and then filter the results.
regardless, I don't think my using closest is causing nopcommerce to strip javascript out of the page :)
When you say it strips off, are you viewing through View Source or the Developer Tool (sounds stupid but just to make sure)? I can't think of a reason why it strips off JS yet, probably due to AJAX? (Need to think harder, might have missed something!)
You can just select 2 sets of form differently. One by #co-payment-info-form and another by .payment-info form.
And just to make sure the original onclick event is not overriding anything, perhaps you can overtake it, and call PaymentInfo.save() inside your very own method? http://stackoverflow.com/questions/2629916/how-do-you-override-inline-onclick-event
That is an excellent suggestion once I can see that the javascript for the payment bridge is being included in the page :)