Welcome to the nuBuilder Forums!

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

Copy Textarea Content from Popup to Subform in nuBuilder Topic is solved

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

Copy Textarea Content from Popup to Subform in nuBuilder

Unread post by yvesf »

Hello,

In nuBuilder, I have a subform that contains a button and a textarea field named textareasubform. When I click the button, it opens a popup which contains another textarea field named textareapopup, along with a button labeled "Copy Textareapopup".

The purpose of this button is to copy the content of textareapopup from the popup back into the textareasubform field in the subform.

How can you do that ? Is subform is considered as a child of the parent form ?

Thank you very much for your help!

Yves
steven
Posts: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 times

Re: Copy Textarea Content from Popup to Subform in nuBuilder

Unread post by steven »

Hi yvesf,

Can you share your database?


Steven
A short post is a good post.
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Copy Textarea Content from Popup to Subform in nuBuilder

Unread post by yvesf »

Here is the database
2025-05-11_042020_68203394d4dbe_nuBuilder_backup.zip
Yves
You do not have the required permissions to view the files attached to this post.
steven
Posts: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 times

Re: Copy Textarea Content from Popup to Subform in nuBuilder

Unread post by steven »

yves,
yves wrote: The purpose of this button is to copy the content of textareapopup from the popup back into the textareasubform field in the subform.

How can you do that ? Is subform is considered as a child of the parent form ?

Thank you very much for your help!
I'm sorry man, I don't understand your question or questions.


Steven
A short post is a good post.
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Copy Textarea Content from Popup to Subform in nuBuilder

Unread post by yvesf »

Dear Steven,

I have created a dedicated nubuilder app focusing on this pb precisely.
Here is how it works
Clic on Visits button
visit.png
Clic on the first line to open the record
Clicfirstline-2.png
Clic on the build button of the first prescription currently empty to build the prescription
cliconbuildbutton_2.png
A popup appears in which we build the prescription
textareapopup.png
Behind the button I would like to copy the content of the texarea popup into the teextrea related prescription record.
InsertButton.png
Behind the button Insert AI result you have the current script

Code: Select all

parent.nuSetValue('pre_prescription',nuGetValue('blr_prescription_ai'));
Unfortunately this code doesn't work probably because we have to insert in the subform on the first record which is different than writing in a form. Any help will be highly appreciated.
I hope it is clearer.
Many thx for your help,

Yves
You do not have the required permissions to view the files attached to this post.
steven
Posts: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 times

Re: Copy Textarea Content from Popup to Subform in nuBuilder

Unread post by steven »

OK,

I think I understand.

You want blr_prescription_ai to populate pre_prescription.

But every subform field is a combination of 3 things.

Subform Name : vis_prescription_sf
Row number : 000
Object Name : pre_prescription

(vis_prescription_sf000pre_prescription)

So your nuSetValue() code won't work with just pre_prescription.


Steven
A short post is a good post.
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: Copy Textarea Content from Popup to Subform in nuBuilder

Unread post by yvesf »

Yes !!!!! How do you retrieve the Row number in the subform to transfer it to the popup and return back to the right row ? I have tried with nuCurrentRow() on the subform and a counter on the related form in order to be able to create the field with the right row number : it seems to me overkilling for something simple.
Many thx anyway .

Yves
steven
Posts: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 times

Re: Copy Textarea Content from Popup to Subform in nuBuilder

Unread post by steven »

Try this...

Code: Select all

parent.nuSetValue('vis_prescription_sf' + parent.nuCurrentRow() + 'pre_prescription',nuGetValue('blr_prescription_ai'));


Steven
A short post is a good post.
Post Reply