Hello,
I believe there is a space missing between returnand 2. The below should work.
(function(){
if(fieldname3==’US’&&fieldname3==’MD’&&fieldname5<= 0.4) return 2;
})();
Hi Damn! … no, it isn’t working with space between return and 2.
I have a dropdown selection field at fieldname3 amd fieldname4 and a number field at fieldname5.
Any other ideas?
Thanks a lot for your help in this matter.
Hello @henrycproject and @greedymind,
The single quotes that are using both in the code are wrong, you are using the single quotes symbols ’’ but the correct ones supported by javascript are ''
So, the equation would be:
(function(){
if(fieldname3=='US' && fieldname3=='MD' && fieldname5 <= 0.4) return 2;
})();
By the way, the equation returns a result only if the condition is satisfied.
If the issue persists, please, include in your ticket the link to the webpage where the form is inserted.
Best regards.
Thanks codeople… have copied your code but it still not working … 🙁
Hello @henrycproject,
I’m sorry, but I cannot help you if you don’t include the link to the webpage where the form is inserted.
Best regards.
I did included it… it is hold for moderation… within 72 hours…
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
Spam queue. The 72 hours just means someone will come along and de-queue your reply as I’ve just done.
Codepeople, the link is alive here already. Thanks
Hello @henrycproject,
Your current equation is:
(function(){
if(fieldname3=='US' && fieldname3=='MD' && fieldname5<0.4) return 2.20;
if(fieldname3=='US' && fieldname3=='MD' && fieldname5=0.4) return 2.64;
if(fieldname5>30) return 'GREUTATE MAXIMA ADMISIBILA 30KG';
})();
Now, I will explain all errors in your equation:
First, fieldname3 cannot be at the same time equal to 'US' and 'MD', so, the first and second conditional statements won’t be valid never.
Second issue, in javascript the comparison operator for equality is “==” because the symbol “=” is used for assignment, so, in the second rule the correct would be: fieldname5==0.4
Best regards.
got it… everything is working now! thanks a lot