js: expose submit function