How to make the user fill out all required fields when signing up

In the registration form for a website, what is the best way to prevent the user from continuing until all the required fields are filled in? For example should the "submit" button be grayed out until the username, password etc. be filled in? By the way, beside the field where the user chooses a password, as they type it indicates the acceptance: "too short" "good", "passwords don't match" etc. (I know some are against making the user confirm their password but I've made my mind on this).