Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter 4Webs

    (@4webs)

    Thank you for the clear answers!

    I’m back again.. I’m using the equation stated above. My customer now wants something different.

    Fields also can be empty, if a field is empty is counts as zero(0) in the equation. But, the result may only display if everything is filled in(huh?). So I was thinking if it’s possible to work with a button that says calculated now. What this button does is; It takes all filled in fields and puts it in the equation. All empty fields are put in the equation as zero(0). And then maybe a new page loads and the result wil be shown there. Is that possible?

    Thanks in advance! 🙂

    Thread Starter 4Webs

    (@4webs)

    Yet again, thanks for the great answer! 🙂

    I wasn’t clear in my last post. The value of any field can be 0(zero). Now, with this equation if a field has 0(zero) as value the equation sees is as NULL(?) and returns nothing instead of the result. Any ideas? != ” doesn’t work.

    Thanks! 🙂

    Thread Starter 4Webs

    (@4webs)

    Thanks again! Great support! 🙂

    The field that should shows the result is called fieldname1. The equalation is now set to:

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    ((fieldname2+fieldname3)-((fieldname2+fieldname3-1428)*0.15+1212+(fieldname4+(fieldname5-(fieldname5*1/3))+fieldname6+fieldname7)))*50

    If i set the equalation to:

    (function(){
    if( !/^\s*$/.test(fieldname2) && !/^\s*$/.test(fieldname3) && !/^\s*$/.test(fieldname4) && !/^\s*$/.test(fieldname5) && !/^\s*$/.test(fieldname6) && !/^\s*$/.test(fieldname7))
    {
    ((fieldname2+fieldname3)-((fieldname2+fieldname3-1428)*0.15+1212+(fieldname4+(fieldname5-(fieldname5*1/3))+fieldname6+fieldname7)))*50
    }
    else
    {
    return '';
    }
    })()

    This still returns a negative value(because the fields arent filled in). Am i doing something wrong?

Viewing 3 replies - 1 through 3 (of 3 total)