I've made bit field with the default options of yes and no: new_Q1
Then i've made a field to collect a amount of points, incase the bit is set
to yes: new_Q1p.
If i select the format of the bit value to "list" my script works fine. If I
select "check box", it does not work.
Can any one help me modyfi the script to work with the check box?
Thanks
Regards, Jacob Mondrup
This is the script I use:
______________________________________________________________________________
var point = 0;
var get_status = parseInt(crmForm.all.new_q1.DataValue);
switch (get_status)
{
//No
case 0:
point = 0;
break;
// Yes
case 1:
point = 10;
break;
}
crmForm.all.new_q1p.DataValue = point;
_______________________________________________________________________________
try...
var get_status = crmForm.all.new_cpdtcs.DataValue;
if ( get_status == true )
point = 10;
else
point = 0;
crmForm.all.new_q1p.DataValue = point;
> .
>
Jacob, you should be aware that onchage code attached to checkbox will
be fired when you change checkbox value and click somewhere else. When
you use list or radiobuttons code is fired immediately after value
change.
Regards,
Dawid Kolodziejczyk
http://team4crm.com
var point = 0;
if(crmForm.all.new_q1.checked)
{
//true
point = 10;
}
else
{
//false
point = 0;
}
NOTE : As said by dave the on change script will be fired only when the
focus comes out of the check box.