Welcome to the nuBuilder Forums!

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

dependent dropdown in a subform

Questions related to customising nuBuilder Forte with JavaScript or PHP.
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: dependent dropdown in a subform

Unread post by johan »

Kev1n

I still got the same result in my subform. Only Turnhout in the first row gevangenis and the rest is blanc.

Johan
kev1n
nuBuilder Team
Posts: 4301
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: dependent dropdown in a subform

Unread post by kev1n »

Can you export your db again?
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: dependent dropdown in a subform

Unread post by johan »

Kev1n
Thanks for your help.
Johan
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4301
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: dependent dropdown in a subform

Unread post by kev1n »

I forgot to mention that the SQL is messed up:

Code: Select all

SELECT distinct secties.sec_id, secties.sec_name FROM secties where secties.sec_gevangenis = WHERE secties.sec_gevangenis = '#VALUE_SELECT1#'
   OR '#VALUE_SELECT1#' LIKE '#%';
This is correct:

Code: Select all

SELECT distinct secties.sec_id, secties.sec_name FROM secties 
WHERE secties.sec_gevangenis = '#VALUE_SELECT1#'
   OR '#VALUE_SELECT1#' LIKE '#%'
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: dependent dropdown in a subform

Unread post by johan »

Kev1n
Thanks a lot for your help. Now the items on subform are populated correct.
Since this change I occur a problem with depending select using

Code: Select all

 ("#act_lokaal").empty();
nuRefreshSelectObject('act_lokaal');
$("#act_sectie").empty();
nuRefreshSelectObject('act_sectie')
Could it be that there is a conflict with subform items?
kev1n
nuBuilder Team
Posts: 4301
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: dependent dropdown in a subform

Unread post by kev1n »

Replace the function nuRefreshSelectObject() in nucommon.js with this one and log in again:

Code: Select all

function nuRefreshSelectObject(selectId, formId, removeBlank) {

	if (typeof formId === 'undefined') {
		var formId = '';
	}

	nuSetProperty('nurefreshselectobject_selectid',selectId);
	nuSetProperty('nurefreshselectobject_formid',formId);
	nuSetProperty('nurefreshselectobject_prefix','');
	nuSetProperty('nurefreshselectobject_removeblank',removeBlank === true ? '1' : '0');

	nuRunPHPHidden('nurefreshselectobject', 0);

}
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: dependent dropdown in a subform

Unread post by johan »

kev1n

I finaly could test this and it works fine.
Thanks a lot for your help!

Johan
Last edited by johan on Fri Dec 03, 2021 2:18 pm, edited 1 time in total.
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: dependent dropdown in a subform

Unread post by johan »

kev1n

I finaly could test this and it works fine.
Thanks a lot for your help!

Johan
Post Reply