Thank so much Srini, that works exactly as I needed.
A follow up question:
Is there any easy way to open that code to muliple fields?
The only way to reuse the code with multiple fields is by using the Script Object.
Place all the common code to Script Object and call the function in all the fields.