Welcome to the nuBuilder Forums!

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

nuPopup - how to use it

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

nuPopup - how to use it

Unread post by yvesf »

Hi,

I want to use a function to open a browse and edit form as a popup. I tried nuPopup, but no popup appears regardless of the syntax I use. I found examples with 3 or 4 parameters on the forum, but they don’t work for me.

I have a main document where I’d like to open a popup, select predefined values, and insert them into a WYSIWYG field in the main document.

Is nuPopup the right method? If so, could you provide an example?

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

Re: nuPopup - how to use it

Unread post by kev1n »

Same question ?viewtopic.php?t=12390
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: nuPopup - how to use it

Unread post by yvesf »

No it's a different question very basic in fact, I cannot even implement nuPopup. It's behind the button on the onclick event (custom code tab) on the main edit form.

Code: Select all

nuPopup('6797ea4743e083a', '', '');
and
FormId.png
No effect
Many thanks for providing me the right syntax and context of use. A small example will help a lot.
Yves
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuPopup - how to use it

Unread post by kev1n »

The syntax to open a popup window is correct.

Would it be possible to upload a dump of just this form (using the Cloner)?
And also dump the corresponding table (data can be excluded) so I can test it on my end to see if anything is flawed.
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: nuPopup - how to use it

Unread post by yvesf »

Here is the backup.
01-28-2025_122737_6798db49da5eb_nuBuilder_backup.sql.gzip
On fastform
- consultation button
- open a consultation
- behind motif button you have the script with nuPopup
Thx

Yves
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuPopup - how to use it

Unread post by kev1n »

I installed your database and tested the popup. As you can see, it opens without any problems.
You do not have the required permissions to view the files attached to this post.
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: nuPopup - how to use it

Unread post by yvesf »

Sorry, I work too much, it was because I have implemented behind onchange event and not onclick event ....after having search around popup blockers and parameters in chrome and other devices tested with open.window.....I am sorry to have taken your time.....
How to open the popup in edit mode to create a new record ?
Thx again for your continuous help. Yves
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuPopup - how to use it

Unread post by kev1n »

Pass a 2nd parameter "-1" to nuPopup() to open a new record.
yvesf
Posts: 315
Joined: Sun Mar 14, 2021 8:48 am
Location: Geneva
Has thanked: 87 times
Been thanked: 11 times

Re: nuPopup - how to use it

Unread post by yvesf »

:ponder: pops up always the browse form not the edit form.

Code: Select all

nuPopup('6797ea4743e083a','-1','')
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuPopup - how to use it

Unread post by kev1n »

I also executed `nuPopup('6797ea4743e083a', '-1', '');` on your database, and it successfully opens a new record in an Edit Form.

How is the code being executed on your end? Can you test it again? I don't see any reason why it shouldn't work.
Post Reply