Skip to main content

Hi fellow nintex Admins,

its me again....

i work with a calculated value, to sum some other fields, what works fine

180163_pastedImage_0.png

in the user form it looks like this:

180167_pastedImage_1.png

the calculated value field has formating option, but the do not seem to work. How can i get black borders like the other text fields?

The second question is, how do i get the calculated value in other fields. For example, if 5 guests are coming, i want to set the textfield "Wlan:" to "5"

180168_pastedImage_2.png

Thank your for your help here.

Daniel

Hi Daniel,

the formating of the calculated value field works for me, I can set borders by configuring the action. Workaround would be to use CSS to style the control. Did you try to change border width or do you have any other styles applied that maybe erase the border?

For setting the text field you can use some Javascript code. For example for the two "Anzahl" fields you create an onBlur action to write the sum of both fields back to your wlan textfield whenever a user leaves the input field.

Regards

Philipp


Hi Philipp,

thank you for your answer. Do you have an example for that Javascript or is there a Nintex Tutorial / Helpfile for this?

Regards

Daniel


Hi Daniel,

sorry for letting you wait that long but I had some days off and tried to avoid doing anything work-related at all silly.png

Unfortunately there are only basic Javascript tutorials available with Nintex but I recommend to check these as well because they give you a basic understanding of what you always need to know when using Javascript on Nintex forms.

Here is some basic javascript code that writes back the numbers you entered in the two text fields back to another text field:

NWF$(document).ready(function() {

NWF$('#' + inputOne).val("0");

NWF$('#' + inputTwo).val("0");

var valueOne;

var valueTwo;

var resultValue;

    NWF$('#' + inputOne).blur(function() {

        valueOne = parseInt(NWF$('#' + inputOne).val());

        valuetwo = parseInt(NWF$('#' + inputTwo).val());

        resultValue = valueOne + valuetwo;

    

        NWF$('#' + resultText).val(resultValue);

    });

    NWF$('#' + inputTwo).blur(function() {

        valueOne = parseInt(NWF$('#' + inputOne).val());

        valuetwo = parseInt(NWF$('#' + inputTwo).val());

        resultValue = valueOne + valuetwo;

    

        NWF$('#' + resultText).val(resultValue);

    });

});

I presume you have two input fields (in my example "inputOne" and "inputTwo") where numbers are entered. Whenever you move the cursor out of one of that fields, the blur event is triggered and the values of both fields are summed up and written back to another text field called "resultText". Lines 3+4 are only to set a default value of "0" to the input fields, don't know if you really need this. If you enter anything else than numbers you'll get "NaN" as a result (Not a Number).

The code may not be perfect but it's working and can be adapted for your use case. Let us know if you need further assistance.

Regards

Philipp


Hi Philipp,

no problem, i had no time too.

I think i unterstand your code, but it doesn't work for me. Nothing happends in the form.

I have one formula field:

183049_pastedImage_0.png183077_pastedImage_1.png

and three other fields, where the value from the formula field should be insert.

183078_pastedImage_2.png

I would change them to calculated fields too, but the user can change this values.

Is there really no way to achieve this without coding?

Cheers Daniel


Hi Daniel,

I'm not sure if it's possible without code. The only option I see is to set the default Value of three fields to the value of your formula field. But I don't think this will work, because the system will only populate the default value when the form is opened. Besides I'm not sure if you can use your formula field as a default value.

But the JavaScript code should work for you too, of course you need to adapt it to your environment.

Can you please show me the code (or a screenshot of the code) you entered in your Form Settings?

Regards

Philipp

p.s.: In case you want to further explain your issue in german, you could also write me a message directly.


Reply