Welcome to the nuBuilder Forums!

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

calculate sum of select fields?

Questions related to using nuBuilder Forte.
Post Reply
ARWEN
Posts: 78
Joined: Thu Nov 01, 2018 6:01 am

calculate sum of select fields?

Unread post by ARWEN »

Hi guys,

I have created an evaluation form with 50 select fields. These each contain the values 1...10. Now I wanted to display the sum in a Calc field. But these select fields are not available in the Formula-Builder. Why not?
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: calculate sum of select fields?

Unread post by admin »

ARWEN,

It doesn't calculate Select Objects.

Steven
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: calculate sum of select fields?

Unread post by kev1n »

If you apply a little 'hack', you can manually add fields to the Formula Field and modify the formula as you want.
Then it even calculates Select Objects (if they contain numbers)!

This "manual mode" is also convenient if you need to modify the formula later. Currently you need to delete and recreate the formula. Especially for larger formulas, the "manual mode" has proven useful!

All you need to do is add this JavaScript under Setup -> Header:

Code: Select all

function nuOnLoad() {

	var p = nuCurrentProperties();
	if ((p.form_id == 'nuobject')) {
		// Calculator not readonly
		$("#sob_calc_formula").prop("readonly", false).removeClass('nuReadonly');
	}
}
manually edit formula.png
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: calculate sum of select fields?

Unread post by admin »

Guys,

Select Objects are now included.

The changes are now on Sourceforge.


Steven
Post Reply