Welcome to the nuBuilder Forums!

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

Save content of HTML object into db and reload it in the HTML object

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

Save content of HTML object into db and reload it in the HTML object

Unread post by yvesf »

Hello,

I am using HTML object which is updated with values like href links. I would like to save the content of this html object on save and reload it next time. I have created another textarea object which content the same content as html has. The content of the html is now saved in the database.
When I reload it, I would like to reload the content of the html control has it was before. Any idea about how to do that ?
Many thanks,

Yves
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Save content of HTML object into db and reload it in the HTML object

Unread post by kev1n »

Like this?

Code: Select all

nuSetValue('htmlobjectid', textareaid.value, 'html');
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Save content of HTML object into db and reload it in the HTML object

Unread post by yvesf »

I have put your code behind onnuload() and it works. I have tried with

Code: Select all

nuSetValue('htmlobjectid', nuGetValue('textareaid'), 'html');
and it doesn't work. Why this syntax doesn't work as opposed to yours ?
Many thanks Kev1n again. I was lost.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Save content of HTML object into db and reload it in the HTML object

Unread post by kev1n »

nuGetValue('textareaid') and textareaid.value returns the same for input objects.

Any errors in the developer console?
Post Reply