Welcome to the nuBuilder Forums!

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

Difference between nuSetValue and this.value

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
yvesf
Posts: 338
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 92 times
Been thanked: 11 times

Difference between nuSetValue and this.value

Unread post by yvesf »

Dear All,

In JavaScript, I’m using the following code in nuOnLoad() in a popup edit form to populate a text field:
nuSetValue('my_field_id', parent.nuRecordId());
When saving, it works without any problem.

However, if I replace it with:
this.value = parent.nuRecordId();

then the field shows the correct value when the form opens, but it won’t save.

Could someone explain why this.value doesn’t behave the same way as nuSetValue?

Thanks for your help,
Yves
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Difference between nuSetValue and this.value

Unread post by kev1n »

Hi Yves,

I explained it here: viewtopic.php?p=30650#p30650

You can also write it as nuSetValue(this.id, parent.nuRecordId());
Post Reply