different processes in one js, want to call different ones from forms in one jade

I have an index.jade file, with two forms login and register. At the moment they are calling a seperate js file each (action='/login' and action='/register'). I was wondering if I can put the two processes into one js file like index.js having exports.register and exports.login, but I don't know how to differentiate between them depending on which form is submitted; what the action would be in the forms? Or if this is possible?

I don't mind having them like this at the moment, my problem is now I'm trying to create a profile page with different forms, I don't want to have seperate js files for each section.

Are you using express framework? Then you could create one route for both actions. for example: account/login and account/register would use one route called "account", that will be in account.js file. Something like this:

var routes = require('./routes');

app.get ('/account/:action', routes.account);

actions will be: register and login

EDIT: As Mike mentioned you can get action value like this: req.params.action