Page 1 of 1

set value reqires refresh to see

Posted: Thu Feb 23, 2023 10:13 pm
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?

Re: set value reqires refresh to see

Posted: Fri Feb 24, 2023 4:11 am
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.

Re: set value reqires refresh to see

Posted: Fri Mar 03, 2023 9:51 am
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.

Re: set value reqires refresh to see

Posted: Fri Sep 01, 2023 7:42 pm
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

Re: set value reqires refresh to see

Posted: Fri Sep 01, 2023 9:45 pm
by kev1n
Possibly the issue was fixed a few days ago (See update on Github)

Re: set value reqires refresh to see

Posted: Sat Sep 02, 2023 9:58 am
by steven
Hi, treed and fmuller.

Can you break the problem down with some pictures?

It might help us recreate the problem.


Steven