Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

if else function Topic is solved

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
warfreak
Posts: 6
Joined: Sat Jan 02, 2021 4:03 am
Location: Usa

if else function

Unread post 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"
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4298
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: if else function

Unread post 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');
warfreak
Posts: 6
Joined: Sat Jan 02, 2021 4:03 am
Location: Usa

Re: if else function

Unread post by warfreak »

thanks its working,
Post Reply