How to make the system auto clicked the button in client side?

How to auto clicked the Generate Payables when there is a value in Sales Agent Name?