Using If Then to assign values

0

Let me start off by saying I rarely do any coding, but if given an example, I can usually play around with it and make something work. I didnt think this would be that difficult. Here is the issue I have. I have a drop down box of all possible zip codes a respondent may select. I want to group specific zip codes into specific “buckets”. The drop down answer is in question 2 (hence the id=2). Eventually I will have 5 or 6 zip codes per bucket, but I am just trying to see if I can get it to work for two with an OR statement, but I keep getting an error. Based on their zip selected, I would like the group classification to be set in textbox 22. The error I keep getting is :

[string “line”]:10: ‘)’ expected near ‘,’

This is the script I have placed on the same page where the textbox(22) is.

id=2;

zip1=12345

zip2=67891

zip3=23456

zip4=78901

zip5=34567

zip6=89123

test=getvalue(id)

if (test==zip1) or (test=zip2) then (setvalue(22), “Group1”)

else if (test==zip3) or (test=zip4) then (setvalue(22), “Group2”)

else if (test=zip5) or (test=zip6) then (setvalue(22), “Group3”)

end

Any help would be greatly appreciated!

Frank Mezler asked
    ×

    Login

    Question stats

    • Active
    • Views59 times
    • Answers0 answers
    • Followers1 follower