All,
I am having a mental block and need some help please.
I am trying to write a client script which is called on a online form, I want the script to look for changes to a checkbox field, when the checkbox is checked to make a field disabled I can do this fine, but what I also want to happen is if the user unticks the box the script need to re-enable a field. Whilst my script allows me to disable the field when checked it does not detect the field changing again. I am trying to accomodate thoose users that tick boxes by mistake and need to go back and change the mistake.
I imagine I need to have the code that detects the field change and set the field in a loop until the form is submitted to allow for additional field changes but can't figure out how to do that. Current code below.
function fieldChanged(type,name,linenum) { if ((name == 'custrecord_bsb_top_up') && (nlapiGetFieldValue('custrecord_bsb_top_up') == 'T')) { nlapiDisableField('custrecord_bsb_po_transaction',true); } if ((name == 'custrecord_bsb_top_up') && (nlapiGetFieldValue('custrecord_bsb_top_up') == 'F')) { nlapiDisableField('custrecord_bsb_po_transaction',false); } }