cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated fields/controls in forms

I am making a form where I need a calculated value to appear inside a text line input control. The problem is I need it to be in a switch format, such as IF(value == "888"){//calculated field = 10} and so on with various combinations. How can I achieve the presentation of this in the forms?

0 Kudos
Reply
2 Replies
Not applicable

Re: Calculated fields/controls in forms

How can I handle multiple "replace" inline functions? Is this just not supported

0 Kudos
Accept as Solution Reply
Not applicable

Re: Calculated fields/controls in forms

So I had to learn about the custom javascript from a coworker. In there it took lots of searching to find out this much but I still don't understand what NWF$ is, jquery? I don't know yet. I wanted to have a formula to input the right data into another text field, i.e. default value calculations, that took indexType and put the information into transducer's text line control/input box.

This achieves what I wanted. Finding out what val and attr are is still a mystery to me. I got these from blogs and the developer tools of my browser but neither helped very much in actually understanding it. Why do I have a # concat with the name? IDK, maybe one day I will find a suitable explanation or a source to learn.

Note: on the control settings->advanced->Client ID JavaScript Variable Name I put "indexType1" and "transducer1", you can also name the CSS class, and do NFW$('.cssclassname') to access the variables. I would try the references but this works and I'm not trying to use up more time figuring out another way at the moment.

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

    NWF$('#' + indexType1).change(function(){

        switch( NWF$('#' + indexType1).val() ) {

            case "860":

            case "883":

                NWF$('#' + transducer1).attr("value", "0-30");

                break;

0 Kudos
Accept as Solution Reply