JS handler for handling async forms