There are LOTS of good resources for learning how to do Dynamics CRM form-scripting — i.e., placing JavaScript code behind the onLoad and onSave form events, and behind the onChange event of any field ...