Convert function to add form to return HTML instead of output directly to