I solved it, for future references: the theme was using a custom compiled version of jquery with god knows what plugins embedded in it, removed and replaced with a clean version everything works fine now.
I dont think you can do it in this way, you could either use an ajax approach or a multi step.