Welcome to the nuBuilder Forums!

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

set value reqires refresh to see

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 reqires refresh to see

Unread post by treed »

When opening a popup I have code in the php before edit to lookup the users name and email and place it on the form.

Code: Select all

$s  = "SELECT * FROM zzzzsys_user WHERE zzzzsys_user_id = '#USER_ID#'";
$t  = nuRunQuery($s);

if (db_num_rows($t) == 1) {
    $r = db_fetch_object($t);
    //$to = $r->InvtTo;
    $from = $r->sus_name;
    $email =$r->sus_email;
}
$j = " nuSetValue('EmailFrom','$email'); ";
nuAddJavascript($j);
It properly looks up the values, however to see them the user needs to press refresh. Is there a way to automatically show the value?
Also what would be the best way to set the value for the name field?
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 reqires refresh to see

Unread post by kev1n »

Hi,

I'm not able to replicate it in this test form.

Also what would be the best way to set the value for the name field?
Just in the same way as you set it for the email.
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 reqires refresh to see

Unread post by kev1n »

Hi ,

Have you been able to get it to work? If so, that's great! If not, please let me know and I'll do my best to provide further assistance. Don't hesitate to ask if you have any more questions or need any more help.
fmuller
Posts: 6
Joined: Sun Apr 09, 2023 10:06 am
Has thanked: 1 time

Re: set value reqires refresh to see

Unread post by fmuller »

Hello,
FYI got the same behavior on my side:
* used run / button
* RECORD_ID not defined
in this case BE PHP code is not executed (and so nuAddJavascript and others) but it works after a refresh

if a RECORD_ID is set then it works.

Regards
François
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 reqires refresh to see

Unread post by kev1n »

Possibly the issue was fixed a few days ago (See update on Github)
steven
Posts: 369
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 52 times
Been thanked: 52 times

Re: set value reqires refresh to see

Unread post by steven »

Hi, treed and fmuller.

Can you break the problem down with some pictures?

It might help us recreate the problem.


Steven
A short post is a good post.
Post Reply