I'm having trouble finding a way to get javascript block from execution.

I have a html form where a user enters email and password

I want to do basic validation in javascript
(1) email is entered
(2) password is entered

If both are not NULL then I call ajax (jquery - model) make a call to backend php to validate if the email and password is correct - During this period of time - I want the...