Have an idea?

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

I need to check if QY is not code 1 and QX is less than 2 then display an error at QY

I need to check if QY is not code 1 and QX is less than 2 then display an error at QY. I created the below but the page stuck at QY and cannot continue to the next page:

if (parseInt(document.getElementById("QY").value)<2 && [% Value(QX) %]<>1 )
{
              strErrorMessage = '[%ListLabel(MessageErreur, 4)%]';
}
asked May 11 by Ali
reshown May 21 by Walter Williams
There is no "<>" operator in JavaScript.  You should use "!=" instead.

What question type is QY?  QX is on a previous page of the survey, correct?
Thank you for the reply.

QY is a numeric question with minimum of 1 and max of 15 and QX is a single (Yes/No) question.
I think you accidentally typed "QY" for both of those.  I assume that your yes-no question is a radio-type select question, but I'm not sure what a "date question" is.  Is that another select question?
You are correct, I meant:

QY is a numeric question with minimum of 1 and max of 15 and QX is a single (Yes/No) question.
In that case, I believe your code will work once you address the "<>" matter mentioned above.
Thank you!

Your solution to the original question

Please only use this to answer the original question. Otherwise please use comments.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

To avoid this verification in future, please log in or register.
...