You may have no choice. One cannot just cut and paste custom scripts since there are any number of things that need to be changed to match the form into which the script is being copied.
See the following tutorial:
Disabling (graying-out) Form Fields by Thom Parker
You will need to change the field names to match your form.