Page 1 of 1

if else function

Posted: Sun Aug 14, 2022 6:23 pm
by warfreak
hi all, i'm new with java script need help with custom code if the balance is 0 status will be "PAID" else "Unpaid"

Re: if else function

Posted: Sun Aug 14, 2022 6:44 pm
by kev1n
Hi,

Code: Select all

nuSetValue('status', 'status: ' + (balance.value == 0 ? 'Paid' : 'Unpaid'));
  • replace status with the id of your status object
    replace balance with the id of your balance object
If the status isn't changed, pass 'html' as 3rd argument:

Code: Select all

nuSetValue('status', 'status: ' + (balance.value == 0 ? 'Paid' : 'Unpaid'),'html');

Re: if else function

Posted: Mon Aug 15, 2022 6:04 am
by warfreak
thanks its working,