Welcome to the nuBuilder Forums!

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

How to add extra 'description' boxes on lookup

Questions related to using nuBuilder Forte.
Post Reply
Keith-i
Posts: 88
Joined: Wed Jan 18, 2023 3:03 pm
Has thanked: 1 time
Been thanked: 1 time

How to add extra 'description' boxes on lookup

Unread post by Keith-i »

When creating a lookup you get the option to add another field of related data in an adjacent description box by selecting the field you want to be displayed. Is there any way to add extra boxes to show further data? Ideally I need to add 2 further boxes so that the user can, at a glance, see that they have selected the right record. I'm presuming I use the 'Display' type but I'm lost as to how to implement it to show the extra fields.
Keith-i
Posts: 88
Joined: Wed Jan 18, 2023 3:03 pm
Has thanked: 1 time
Been thanked: 1 time

Re: How to add extra 'description' boxes on lookup

Unread post by Keith-i »

Thanks. I've created 2 new read-only 'input' boxes on the form and named them disp_houseno and disp_unitname and placed the below code into the AfterBrowse of the lookup but am not getting any response. Can you spot my error?

Code: Select all

$lu = nuLookupRecord();

nuSetFormValue('disp_unitname', $lu->UnitName);
nuSetFormValue('disp_houseno', $lu->HouseNo);
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: How to add extra 'description' boxes on lookup

Unread post by kev1n »

Add

Code: Select all

nuDebug(nuLookupRecord());
to see what fields are output in nuDebug Results.
Keith-i
Posts: 88
Joined: Wed Jan 18, 2023 3:03 pm
Has thanked: 1 time
Been thanked: 1 time

Re: How to add extra 'description' boxes on lookup

Unread post by Keith-i »

I don't get as far as getting any debug message. As soon as I select a record in the lookup table I get the spinning wheel/egg-timer and nothing happens.

The console gives this

Code: Select all

Uncaught TypeError: $(...)[0] is undefined
    resetIframes http://192.168.1.114/rcsdb/index.php line 2 > injectedScript:35
    onclick http://192.168.1.114/rcsdb/index.php:3
index.php line 2 > injectedScript:35:15
Uncaught SyntaxError: expected expression, got '>'
    nuPopulateLookup http://192.168.1.114/rcsdb/core/nuform.js?ts=20230314134425:4567
    successCallback http://192.168.1.114/rcsdb/core/nuajax.js?ts=20230314134425:599
    success http://192.168.1.114/rcsdb/core/nuajax.js?ts=20230314134425:15
    jQuery 4
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: How to add extra 'description' boxes on lookup

Unread post by kev1n »

Did you really place the code in After Browse? (and not the yellow LUJS field)
Keith-i
Posts: 88
Joined: Wed Jan 18, 2023 3:03 pm
Has thanked: 1 time
Been thanked: 1 time

Re: How to add extra 'description' boxes on lookup

Unread post by Keith-i »

Another schoolboy error! You are spot on, I didn't realise that was a button to press to access the After Browse code box. I had indeed put it in the LUJS. All working now, so thanks again.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: How to add extra 'description' boxes on lookup

Unread post by kev1n »

You're welcome! I'm glad to hear that everything is working now. If you have any more questions or need further assistance, feel free to ask.
Post Reply