Discussion:
Disabling a field from the onChange
(too old to reply)
Matt Pring
2010-05-20 04:36:01 UTC
Permalink
Hi all, I have found similar questions to this one but can't seem to develop
an OnChange event that works for me.

I would like to disable a field (not hidden, just disabled) when a secondary
field had data entered (eg; tick box ticked causes field #2 to become
disabled).

I'm sure this is a simple script but, as a novice with this, cannot seem to
get it working.

Any assistance would be much appreciated.
--
Matt Pring
unknown
2010-05-20 07:18:01 UTC
Permalink
Hi Matt.
I found this en the SDK
{Field}.Disabled
So, when you want to disabled some field you need to do this.
When your field change
crmForm.all.name. Disabled = true;

I let the url where you´ll find the sdk fo Microsoft Dynamics CR
http://www.microsoft.com/downloads/details.aspx?FamilyID=82e632a7-faf9-41e0-8ec1-a2662aae9dfb&displaylang=en

Salu2

Atilio
Post by Matt Pring
Hi all, I have found similar questions to this one but can't seem to develop
an OnChange event that works for me.
I would like to disable a field (not hidden, just disabled) when a secondary
field had data entered (eg; tick box ticked causes field #2 to become
disabled).
I'm sure this is a simple script but, as a novice with this, cannot seem to
get it working.
Any assistance would be much appreciated.
--
Matt Pring
AdamV
2010-05-20 07:51:17 UTC
Permalink
In addition to making it disabled, you may also want to alter the
appearance of the caption or data area to make it obvious that it is
disabled. eg make the color of the caption (label) grey.

Also bear in mind what to do if:
Field 2 is updated by user
Then they tick Field 1
So field 2 is now disabled
Should you also be clearing the contents of field 2? Is their previous
data still valid? Will you need to use ForceSubmit = true to ensure that
the changed data in the disabled field is still updated back to the
database at save?

Hope this helps you work out a full solution

Adam
Post by unknown
Hi Matt.
I found this en the SDK
{Field}.Disabled
So, when you want to disabled some field you need to do this.
When your field change
crmForm.all.name. Disabled = true;
I let the url where you´ll find the sdk fo Microsoft Dynamics CRM
http://www.microsoft.com/downloads/details.aspx?FamilyID=82e632a7-faf9-41e0-8ec1-a2662aae9dfb&displaylang=en
Salu2
Atilio
Post by Matt Pring
Hi all, I have found similar questions to this one but can't seem to develop
an OnChange event that works for me.
I would like to disable a field (not hidden, just disabled) when a secondary
field had data entered (eg; tick box ticked causes field #2 to become
disabled).
I'm sure this is a simple script but, as a novice with this, cannot seem to
get it working.
Any assistance would be much appreciated.
--
Matt Pring
Loading...