Welcome to the nuBuilder Forums!

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

Set value of subform object

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Set value of subform object

Unread post by treed »

I see how to use JS to get the value of a subform object. How could one set the value of a subform object?

I've got an invoice line item with tiered pricing. Right now if the users enters the quantity and selects an item and the correct pricing is retrieved and placed in the row. However if someone changes the quantity I need to see where this new value fits within the tiers and change the pricing on the row.

Also on the Wiki, the nuSetValue section shows the structure for nuGetValue.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Set value of subform object

Unread post by kev1n »

Add an onchange event to the quantity field that updates the corresponding price value in the same row. In the provided example, '12345' is the current value set for the quantity field (the correct price must be retrieved somehow)

Code: Select all

nuSubformRowObject(event.target.id, 'your_prive_id').val('12345');
Post Reply