• Resolved kna1337

    (@kna1337)


    Hello, need help.
    if(fieldname4>500) { alert( ‘WARNING 500 mm’ )}
    How to display alert only once, if the condition is met

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter kna1337

    (@kna1337)

    And how to display errors not through alert

    Plugin Author codepeople

    (@codepeople)

    Hello @kna1337

    If fieldname4 is a calculated or number field, you can enter the number 500 as its “MAX” attribute, and you would not need the alert.

    Best regards.

    Thread Starter kna1337

    (@kna1337)

    This is for example, I have mathematical calculations there, connections between fields, and if, according to the condition, the calculation goes beyond the border, it should issue a notification how to take it out not through an alert

    Thread Starter kna1337

    (@kna1337)

    example:

    if(fieldname2+fieldname3*2+70>4000) { alert( 'WARNING!' )}
        if(fieldname2+fieldname3*2+70<150) { alert( 'WARNING!' )}
                if(fieldname3*2+fieldname4+80<250) { alert( 'WARNING!' )}
                    if(fieldname3*2+fieldname4+80>1400) { alert( 'WARNING!' )}
    Plugin Author codepeople

    (@codepeople)

    Hello @kna1337

    If you don’t want to display an alert, you can insert an “HTML Content” field in the form and define it as dependent on the calculated field you are using for validating the values.

    Please, insert an “HTML Content” field in the form and enter the Warning text as its content with the style and format you prefer. For example:

    <h1 style="color:red">WARNING!!!</h1>

    Now, edit the equation as follows:

    IF(OR(fieldname2+fieldname3*2+70<150, 4000<fieldname2+fieldname3*2+70, fieldname3*2+fieldname4+80<250, 1400<fieldname3*2+fieldname4+80), 1, 2)

    Finally, you can define a dependency in the calculated field settings to display the HTML content field inserted previously when the equation result is equal to 1.

    More information about dependencies by reading the following blog post:

    https://cff.dwbooster.com/blog/2020/03/01/dependencies

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Need help’ is closed to new replies.