Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Maxdiff error sintaxe

I've programmed a free format Maxdiff question with 2 questions (using the same design), but I need to program the error message when the same Item is selected for best and worst.
I've tried in the Advanced tab:

if (SSI_GetValue("FFMD1_b1")=SSI_GetValue("FFMD1_w1"));
{
    var strErrorMessage = "erro";
}
 
but it doesn't work.
Thank you
asked Nov 25, 2020 by Rosilene

1 Answer

0 votes
The operator to use for checking equality is "==".  The "=" operator is used for other purposes in JavaScript and most other programming languages.

While many lines of code ought to end with a semicolon, there are some exceptions.  Your semicolon at the end of the "strErrorMessage" line is fine, but the one at the end of the "if" line should be removed.
answered Nov 25, 2020 by Zachary Platinum Sawtooth Software, Inc. (161,250 points)
Thank you very much!
...