Discussion:
OnLoad Event Not working
(too old to reply)
Matt Pring
2010-07-08 03:06:26 UTC
Permalink
Hi all, I am currently trying to create an OnLoad event which disables a
number of fields when a selected field (tick box) is ticked/true/yes.

Eg; If Field1 has previously been ticked on record, then disable these fields.

I am currently using the below script but this seems to either not work or
cause other events not to fire ... probably a simple error but I'm missing
something ...

Below is the script so far ...

if (crmForm.Field1name.DataValue = true)
{
crmForm.all.FirstName.Disabled = true;
crmForm.all.LastName.Disabled = true;
crmForm.all.Address.Disabled = true;
crmForm.all.JobTitle.Disabled = true;
}

When I run this, the tickbox field automatically gets ticked when loading
the record.

I have also tried using OnChange but the fields become unlocked again when
re-opening the record.

Can anyone help here?
--
Matt Pring
Mahain
2010-07-08 09:14:45 UTC
Permalink
Post by Matt Pring
Hi all, I am currently trying to create an OnLoad event which disables a
number of fields when a selected field (tick box) is ticked/true/yes.
Eg; If Field1 has previously been ticked on record, then disable these fields.
I am currently using the below script but this seems to either not work or
cause other events not to fire ... probably a simple error but I'm missing
something ...
Below is the script so far ...
if (crmForm.Field1name.DataValue = true)
{
crmForm.all.FirstName.Disabled = true;
crmForm.all.LastName.Disabled = true;
crmForm.all.Address.Disabled = true;
crmForm.all.JobTitle.Disabled = true;
}
When I run this, the tickbox field automatically gets ticked when loading
the record.
I have also tried using OnChange but the fields become unlocked again when
re-opening the record.
Can anyone help here?
--
Matt Pring
if should be like
if(crmForm.Field1name.DataValue ==true)
Ranjitsingh Raghuwanshi
2010-07-12 07:39:47 UTC
Permalink
It sould be :
if(crmForm.all.Field1name.DataValue == true)
Post by Mahain
Post by Matt Pring
Hi all, I am currently trying to create an OnLoad event which disables a
number of fields when a selected field (tick box) is ticked/true/yes.
Eg; If Field1 has previously been ticked on record, then disable these fields.
I am currently using the below script but this seems to either not work or
cause other events not to fire ... probably a simple error but I'm missing
something ...
Below is the script so far ...
if (crmForm.Field1name.DataValue = true)
{
crmForm.all.FirstName.Disabled = true;
crmForm.all.LastName.Disabled = true;
crmForm.all.Address.Disabled = true;
crmForm.all.JobTitle.Disabled = true;
}
When I run this, the tickbox field automatically gets ticked when loading
the record.
I have also tried using OnChange but the fields become unlocked again when
re-opening the record.
Can anyone help here?
--
Matt Pring
if should be like
if(crmForm.Field1name.DataValue ==true)
Matt Pring
2010-07-14 07:51:13 UTC
Permalink
Thanks guys, told you it was something simple ... works beautifully ... much
appreciated.
--
Matt Pring
Post by Ranjitsingh Raghuwanshi
if(crmForm.all.Field1name.DataValue == true)
Post by Mahain
Post by Matt Pring
Hi all, I am currently trying to create an OnLoad event which disables a
number of fields when a selected field (tick box) is ticked/true/yes.
Eg; If Field1 has previously been ticked on record, then disable these fields.
I am currently using the below script but this seems to either not work or
cause other events not to fire ... probably a simple error but I'm missing
something ...
Below is the script so far ...
if (crmForm.Field1name.DataValue = true)
{
crmForm.all.FirstName.Disabled = true;
crmForm.all.LastName.Disabled = true;
crmForm.all.Address.Disabled = true;
crmForm.all.JobTitle.Disabled = true;
}
When I run this, the tickbox field automatically gets ticked when loading
the record.
I have also tried using OnChange but the fields become unlocked again when
re-opening the record.
Can anyone help here?
--
Matt Pring
if should be like
if(crmForm.Field1name.DataValue ==true)
Loading...