Having trouble with if else when used with event.value... please help

Please can someone shed any light on where i'm going wrong.
I have a pdf form that uses a drop down menu for the SubBrand and a series of checkboxes for the Location.
the following code is placed as a custom calculation script in an address text field and what im after is dynamically setting the address based on the subbrand and location.
However whats happening is the address only changes based on the location and not the subbrand.
Does anyone please have any advice on this.
Thanks
if 
((this.getField("SubBrand").value == "Passion" || "Passion for Men") && (this.getField("Location").value == "WW")) {
event.value = "Not Applicable";
else if ((this.getField("SubBrand").value == "Passion" || "Passion for Men") && (this.getField("Location").value == "US")) {
event.value = "US02";
else if ((this.getField("SubBrand").value == "Passion" || "Passion for Men") && (this.getField("Location").value == "WH")) {
event.value = "WH02";
else if ((this.getField("SubBrand").value == "Adventure" || "Liquid" || "Silver") && (this.getField("Location").value == "WW")) {
event.value = "WW01";
else if ((this.getField("SubBrand").value == "Adventure" || "Liquid" || "Silver") && (this.getField("Location").value == "US")) {
event.value = "US01";
else if ((this.getField("SubBrand").value == "Adventure" || "Liquid" || "Silver") && (this.getField("Location").value == "WH")) {
event.value = "WH01";
else
event.value = "";

Thanks for the tip GIlad I've amended my code but am still experiencing the issue, im at a loss as to what is preventing the address field from changing when the subbrand changes.
Can you suggest anything else that may be preventing this from happening?
Updated Code:
var subBrand = this.getField("SubBrand").value
var location = this.getField("Location").value
if      ((subBrand == "Passion" || "Passion for Men") && (location == "WW")) {
        event.value = "Not Applicable";
else if ((subBrand == "Passion" || "Passion for Men") && (location == "US")) {
        event.value = "US02";
else if ((subBrand == "Passion" || "Passion for Men") && (location == "WH")) {
        event.value = "WH02";
else if ((subBrand == "Adventure" || "Liquid" || "Silver") && (location == "WW")) {
        event.value = "WW01";
else if ((subBrand == "Adventure" || "Liquid" || "Silver") && (location == "US")) {
        event.value = "US01";
else if ((subBrand == "Adventure" || "Liquid" || "Silver") && (location == "WH")) {
        event.value = "WH01";
else    event.value = "";

Similar Messages

  • I need some help with my java game using applets, CAN SOMEBODY PLEASE HELP

    Hi,
    I am in the process of creating a RPG program using Java. I am not very experienced with java, however the problem i am currently facing is something i can't seem to figure out. I would like to draw a simple grid where a character (indicated by a filled circle) moves around this grid collecting items (indicated by a red rectangle). When the character moves on top of the grid with the item, i would like it to disappear. Right now i am not worrying about the fact that the item will reappear after the character moves away again, because sometimes, when the character moves over the item, nothing happens/another item disappears. i have been at this for 4 days and still cannot figure out what is goign on. can somebody please help me? it would be most appreciated.
    Thanks
    PS if i needed to send you my code, how do i do it?

    Thank you for replying.
    The thing is, I am taking java as a course, and it is necessary for me to start off this way (this is for my summative evaluation). i agree with you on the fact, however, that i should go in small steps. i have been doing that until this point, and my frustration caused me to jump around randomly for an answer. I also think that it may just be a bug, but i have no clue as to how to fix it, as i need to show my teacher at least a part of what i was doing by sometime next week. Here is my code for anybody willing to go through it:
    // The "Keys3" class.
    import java.applet.*;
    import java.awt.*;
    import java.awt.Event;
    import java.awt.Font;
    import java.awt.Color;
    import java.applet.AudioClip;
    public class Keys3 extends java.applet.Applet
        char currkey;
        int currx, curry, yint, xint;
        int itmval [] = new int [5],
            locval [] = new int [5],
            tempx [] = new int [5], tempy [] = new int [5],
            tot = 0, score = 0;
        boolean check = true;
        AudioClip bgSound, bgSound2;
        AudioClip hit;
        private Image offscreenImage;
        private Graphics offscreen;     //initializing variables for double buffering
        public void init ()  //DONE
            bgSound = getAudioClip (getCodeBase (), "sound2_works.au");
            hit = getAudioClip (getCodeBase (), "ah_works.au");
            if (bgSound != null)
                bgSound.loop ();
            currx = 162;
            curry = 68;
            setBackground (Color.white);
            for (int count = 0 ; count < 5 ; count++)
                itmval [count] = (int) (Math.random () * 5) + 1;
                locval [count] = (int) (Math.random () * 25) + 1;
            requestFocus ();
        public void paint (Graphics g)  //DONE
            resize (350, 270);
            drawgrid (g);
            if (check = true)
                pickitems (g);
                drawitems (g);
            g.setColor (Color.darkGray);
            g.fillOval (currx, curry, 25, 25);
            if (currkey != 0)
                g.setColor (Color.darkGray);
                g.fillOval (currx, curry, 25, 25);
            if (collcheck () != true)
                collision (g);
            else
                drawitems (g);
        } // paint method
        public void update (Graphics g)  //uses the double buffering method to overwrite the original
                                         //screen with another copy to reduce flickering
            if (offscreenImage == null)
                offscreenImage = createImage (this.getSize ().width, this.getSize ().height);
                offscreen = offscreenImage.getGraphics ();
            } //what to do if there is no offscreenImage copy of the original screen
            //draws the backgroudn colour of the offscreen
            offscreen.setColor (getBackground ());
            offscreen.fillRect (0, 0, this.getSize ().width, this.getSize ().height);
            //draws the foreground colour of the offscreen
            offscreen.setColor (getForeground ());
            paint (offscreen);
            //draws the offscreen image onto the main screen
            g.drawImage (offscreenImage, 0, 0, this);
        public boolean keyDown (Event evt, int key)  //DONE
            switch (key)
                case Event.DOWN:
                    curry += 46;
                    if (curry >= 252)
                        curry -= 46;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.UP:
                    curry -= 46;
                    if (curry <= 0)
                        curry += 46;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.LEFT:
                    currx -= 66;
                    if (currx <= 0)
                        currx += 66;
                        if (hit != null)
                            hit.play ();
                    break;
                case Event.RIGHT:
                    currx += 66;
                    if (currx >= 360)
                        currx -= 66;
                        if (hit != null)
                            hit.play ();
                    break;
                default:
                    currkey = (char) key;
            repaint ();
            return true;
        public boolean collcheck ()  //DONE
            if (((currx == tempx [0]) && (curry == tempy [0])) || ((currx == tempx [1]) && (curry == tempy [1])) || ((currx == tempx [2]) && (curry == tempy [2])) || ((currx == tempx [3]) && (curry == tempy [3])) || ((currx == tempx [4]) && (curry == tempy [4])))
                return false;
            else
                return true;
        public void collision (Graphics g)
            drawgrid (g);
            for (int count = 0 ; count < 5 ; count++)
                if ((currx == tempx [count]) && (curry == tempy [count]))
                    g.setColor (Color.darkGray);
                    g.fillOval (currx, curry, 25, 25);
                else if ((currx != tempx [count]) && (curry != tempy [count]))
                    g.setColor (Color.red);
                    g.fillRect (tempx [count], tempy [count], 25, 25);
        public void drawitems (Graphics g)
            for (int count = 0 ; count < 5 ; count++)
                g.setColor (Color.red);
                g.fillRect (tempx [count], tempy [count], 25, 25);
        public void pickitems (Graphics g)
            check = false;
            for (int count = 0 ; count < 5 ; count++)
                if (locval [count] <= 5)
                    tempy [count] = 22;
                else if (locval [count] <= 10)
                    tempy [count] = 68;
                else if (locval [count] <= 15)
                    tempy [count] = 114;
                else if (locval [count] <= 20)
                    tempy [count] = 160;
                else if (locval [count] <= 25)
                    tempy [count] = 206; //this determines the y-position of the item to be placed
                if (locval [count] % 5 == 0)
                    tempx [count] = 294;
                else if ((locval [count] == 1) || (locval [count] == 6) || (locval [count] == 11) || (locval [count] == 16) || (locval [count] == 21))
                    tempx [count] = 30;
                else if ((locval [count] == 2) || (locval [count] == 7) || (locval [count] == 12) || (locval [count] == 17) || (locval [count] == 22))
                    tempx [count] = 96;
                else if ((locval [count] == 3) || (locval [count] == 8) || (locval [count] == 13) || (locval [count] == 18) || (locval [count] == 23))
                    tempx [count] = 162;
                else if ((locval [count] == 4) || (locval [count] == 9) || (locval [count] == 14) || (locval [count] == 19) || (locval [count] == 24))
                    tempx [count] = 228;
        public void drawgrid (Graphics g)  //DONE
            g.drawRect (10, 10, 330, 230); //draws the outer rectangular border
            int wi = 10; //width of one square on the board
            int hi = 10; //height of one square on the board
            for (int height = 1 ; height <= 5 ; height++)
                for (int row = 1 ; row <= 5 ; row++)
                    if (((height % 2 == 1) && (row % 2 == 1)) || ((height % 2 == 0) && (row % 2 == 0)))
                        g.setColor (Color.gray);
                        g.fillRect (wi, hi, 66, 46);
                    else /*if (((height % 2 == 0) && (row % 2 == 1)) || ((height % 2 == 0) && (row % 2 == 0)))*/
                        g.setColor (Color.lightGray);
                        g.drawRect (wi, hi, 66, 46);
                        g.setColor (Color.lightGray);
                        g.drawRect (wi, hi, 66, 46); //drawn twice to make a shadow effect
                    wi += 66;
                wi = 10;
                hi += 46;
            } //this draws the basic outline of the game screen
    } // Keys3 class

  • I have a big problem . i forget my resure email address . also forget Sequrity Questions . now i can't buy application with money . just can use free application . Please help me how to fix my problem . Thanks you so much if someone can help my problem .

    i want to buy application . but i can't it because of i forget sequrity question and resure email address .
    i don't know how to continue . i still want to use my current account .
    now my giftcard is waste . i search a lot solution on Apple Support Communities . but still don't know how to continue .
    please help me if someone know . thanks you a big .

    Alternatives for Help Resetting Security Questions and Rescue Mail
    Due to recent changes in how Apple handles this issue, the most successful
    option is #5, below.
         1. Apple ID- All about Apple ID security questions.
         2. Rescue email address and how to reset Apple ID security questions
         3. Apple ID- Contacting Apple for help with Apple ID account security.
         4. Fill out and submit this form. Select the topic, Account Security.
         5.  Call Apple Customer Service: Contacting Apple for support in your
              country and ask to speak to Account Security.
    Note: If you have already forgotten your security questions, then you cannot
             set up a rescue email address in order to reset them. You must set up
             the rescue email address beforehand.
    How to Manage your Apple ID: Manage My Apple ID

  • Ipod not recognized when using an external hardrive, please help me!

    I have a 4 gig ipod mini, I have been using it for over a year with no problems. recently, my computer will not recognize my ipod when it is plugged in with my external hardrive. I have chosen to keep all of my music on a 100 gig external hardrive, because I have a lot of it. when I plug my ipod into my computer and run Itunes my computer will recognize my ipod, open itunes and then the program will freeze. i can also plug in my external hardrive and when i do my ipod is not recognized by the computer at all. I have tried, numerous scans of both hardrives, multiple updates, new USB cords, I have the most current version of itunes and yet I come to see no results, if you know anything please help me, I don't know what else to do.

    http://docs.info.apple.com/article.html?artnum=93499

  • I'm having troubles installing 10.6.3 on my Macbook Pro, PLEASE HELP

    I'm getting the error that seems to happen to a lot of people: "(volume name)" can't be used because it doesn't use the GUID Partition Table scheme.
    When I go to change the Volume Scheme in Disk Utility it's grayed out and says Current, and the Options button is also grayed out, so I can't touch either.
    So I try to boot the machine using the Snow Leopard 10.6.3 disc by holding the "c" key during start-up (bong sound) and it spits the disc out and boots normally... is the SL disc not a boot disc as well? I don't care if i have to format the hard drive, I just want it to work with the newer operating system(s). I'm just worried I'll format my hard drive, go to boot with the disc, and it'll pop it out again.
    Please help. I'm losing hours at work trying to get this thing updated to Mavericks via Snow Leopard

    Do a backup before proceeding.
    Try putting the 10.6.3 disk in the computer. During a restart, hold down the option/alt key, select the disk, and see if you can boot from there. If so, select the language, then go to the Utilities menu, and select Disk Utility. Check to see what partition scheme you have by selecting the hard drive.
    If you don't have GUID, you are going to need to erase the drive and reformat, which will cause you to lose all your data. Did I mention doing a backup?
    If you do have GUID, run Disk Utility repair disk and repair permissions. You may have to do this more than once. Then try in install 10.6.3.
    If successful, use the combo update to get to 10.6.8 and then run Software update until there are no more updates.
    10.6.8 Combo Updater

  • HT1349 having trouble burning cd that i purchased from your store please help ?

    having trouble burning cd that i purchased from your store, can you please help?

    Go to I tunes store page, look to the far right and click on purchased.

  • Need help with Digital Certificates when used with Adobe Acrobat

    Hi,
    I need some urgent help for one of my project. Any help or
    guidence would be very much appreciated...
    I am using Digital Certificates with Adobe Reader 6.0 and
    above and currently if I want to install the process it requires
    around 2 steps. Below are the steps.
    Once the install now button is clicked.
    Step 1. Click on set contract set.
    Step2. Click on first un check box, Adobe 7.0 or Adobe 6.0
    Step3. Click OK,
    Now the Question or issue is, I want to make the above
    mentioned steps 1 to step2 automated, once a user downloads this
    Digital certificate over the Web. Else if I can pre-select the 2
    steps for the ease of the user.
    Any help to get this automated would be much
    appreciated......Do let me know if anybody has any further
    questions...
    Pls help...and thanks for helping in advance..much
    appreciated...
    Cheers
    Ashish

    Hi Ashish,
    Since the title of your post refers to Adobe Acrobat, and the
    mention of RoboHelp is conspicuously absent, I suspect you are in
    the wrong forum. You probably need the Acrobat forum instead.
    Regards,
    Anne

  • Issue with LPAD/RPAD when using with Japanese data

    Hi,
    I am trying to apply LPAD/RPAD on Japanese data, but its giving different results than expected.
    LPAD/RPAD is returning less data than length passed.
    Database: Oracle 10g
    Could some one help me on this.
    SQL Query: select length('アップリカ'),lpad('アップリカ',5,' '), length(lpad('アップリカ',5,' ')) from dual;
    Output:
    LENGTH('アップリカ') --> *5*
    LPAD('アップリカ',5,'') --> アッ
    LENGTH(LPAD('アップリカ',5,'')) --> *3*
    Thanks in advance !!
    Edited by: 871132 on Jul 7, 2011 8:18 PM
    Edited by: 871132 on Jul 7, 2011 8:20 PM
    Edited by: 871132 on Jul 7, 2011 8:21 PM

    I have made a little research and it seems that your problem is connected with way RPAD function works.
    Actually it counts 'display units' instead of 'real' characters count. And in japanesse one 'real' character may be formed from few display units.
    Oracle gives some info about it in its official documentation:
    http://download.oracle.com/docs/cd/B19306_01/olap.102/b14346/dml_x_reserved010.htm
    Some more info is given here:
    http://www.rhinocerus.net/forum/databases-oracle-tools/426832-oracle-bug-rpad-japanese-kanji-character-oracle-10gr2-utf8database.html
    And also sugestion is given:
    +"If you really want the number of characters then you can use+
    +something like:+
    +RPAD ( str , n - LENGTHC(str),'c')+
    +Use LENGTHB, if the requested width is in bytes, LENGTHC, if in+
    +characters+
    +Or+
    +SUBSTR( str || RPAD( 'c', n, 'c' ), 1, n )+
    +Use SUBSTRB, if the requested width is in bytes, SUBSTR, if in+
    +characters+
    +In above the+
    +* str is the string to be padded.+
    +*'c' is the fill character (usually blank) -- we a assume single-+
    +byte char+
    +* n is the requested width in bytes or characters+
    +"+
    Edited by: chudapet on 8.7.2011 1:52

  • Slow SDO_RELATE when using group by.. please help!!

    Hi All,
    I'm fairly new to the spatial side of Oracle so please go easy on me.
    I have 2 tables (a and b), each containing line geometries. There is a one(a) to many(b) relationship between the two.
    I want to write a query which selects information from table b where the geometries in table b are completely covered by the geometries in table a, but the returned info is grouped by the rows in table a.
    Here's my code:
    select
    a.route_id,
    a.step,
    max(b.gritter_status),
    sum(b.salt_usage)
    from
    tbl_routedirs a, tbl_routelinks b
    where
    a.route_id = b.route_id and
    sdo_covers(a.geoloc, b.geoloc) = 'TRUE'
    group by
    a.route_id, a.step
    The query is extremely slow, taking up to 15 minutes to execute...The thing which is confusing me is without the group by clause the statement executes in under half a second.
    I have checked all indexes etc - all are valid. I've tried re-ordering the tables in the from clause as ive read this can be a factor, and granted i have little knowledge as to what to swap where but this appeared to have no impact on the speed.
    Any suggestions would be warmly welcomed... Thankyou.
    Edited by: user8760008 on 27-Aug-2009 07:08 - i copied the script and didnt add the aggregate functions on the selected columns...

    If that's the case, please try:
    select /*+ leading(a) use_nl(a b) index(b your_index_on_b.geoloc) */
    a.route_id,
    a.step,
    max(b.gritter_status),
    sum(b.salt_usage)
    from
    tbl_routedirs a, tbl_routelinks b
    where
    a.route_id = b.route_id and
    sdo_coveredby(b.geoloc, a.geoloc) = 'TRUE'
    group by
    a.route_id, a.step
    i.e. to have a nested loops join, and take a small table as outer.
    Note you may not need all three hints to get the nested loops join plan.

  • Always getting syntax error when using RANK formula. Please help!!

    i am desperate! tried EVERYTHING. so as a last try, I tested the very same Example that Apple gives to elaborate how the "RANK" formula works...and you guessed it....NOT WORKING.
    not even a reconstruction 1 to 1 of the apple example worked, giving me a syntax error.
    thus i am assuming that i am doing something wrong on a very basic level i would have never thought of (maybe a setting i have wrong?, maybe if you have blue as background formulas don't work?).
    i would be sooooo grateful for any help!!!

    Thank you very much for answering this quickly.
    but unfortunately it doesnt work
    i made some screenshots, maybe this way someone sees a maybe obvious mistake i am making
    and
    Message was edited by: Apolloss

  • Having trouble loading ATT and CenturyLink sites with safari now, anyone else having this problem?

    having trouble loading ATT and CenturyLink sites with safari now, anyone else having this problem?

    Howdy MacRocker,
    Thanks for using Apple Support Communities.
    To start with troubleshooting an issue like this where you're unable to load certain websites in Safari, I suggest that you clear out your browser history and website data.
    Safari 8 (Yosemite): Clear your browsing history
    Happy Holidays!
    Alex H.

  • HT4623 Anyone have trouble with iPhone 5c when using Siri?

    Anyone having with iPhone 5c when using Siri?

    I have a problem when I am using the SIRI and have # contacto, for example mark with siri #995012607.

  • Is anyone else having trouble seeing their screens when you are outside?

    Is anyone else having trouble seeing their screens when you are outside?

    When is sunlight, absolutely. Not a problem with the Droid Ultra but rather all phones.
    You ever see the commercial about the Nook devices. The have a special screen to reduce glare allowing you to see your screen in sunlight.
    As far as I know, companies have not implemented this on anycell phone.
    There are after market anti-glare screen protectors
    Check Amazon or eBay, they should be relatively inexpensive.
    Good Luck

  • Hi! I have an x-mini headset which im having trouble pairing to my iPhone 5s with bluetooth, any tips please?

    Hi! I have an x-mini headset which im having trouble pairing to my iPhone 5s with bluetooth, any tips please?

    Cellular calling doesn't yet work reliably.
    Make sure you've followed the instructions in this support article. Note that both iCloud and FaceTime on the Mac must be signed in to the same Apple ID; those are two separate steps. Also note that the Mac and the phone must be connected to the same Wi-Fi network. Ethernet won't work. Trying to pair the phone to the Mac as a Bluetooth device won't work either.
    If cellular calling still doesn't work, sign out of FaceTime and sign back in. You may have to do the same on the phone. The email address that you use as your Apple ID must be able to receive FaceTime calls.

  • Camera is hanging when using with flash

    Hi Lenovo Team,
    In lenovo vibe x2, camera is hanging when using with flash.Getting "Lenovo snapit isnt responding" error and screen hanged for sometime.after that when tried to open camera "Cannt cannot to camera " error is coming till when restart the phone.
    Even tried Factory reset and software update.
    Please provide the solution for the above issue.
    Thanks,

    Hi vijayprabhu,
    I just tested the X2 however am not having the issue. I set flash to always on then took a picture using SnapIt however its fine.
    Please check if you have the latest firmware S125.
    Check out the Community Knowledge Base for hints and tips.
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
    X240 | 8GB RAM | 512GB Samsung SSD

Maybe you are looking for

  • Not able toView Data in Answers

    Hi, I created small Repository sai.rpd but when i logon to the answers i am un able to see the data. i am getting the below error Odbc driver returned an error (SQLExecDirectW). Error Details Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P State: HY000. Code

  • My iPod Touch won't sync, charge and is not recognised in Computer

    Hi, I have tried all the support suggestions on the Apple site, but my iPod Touch, that is less than 6 months old, does not come up on My Computer when connected, will not charge on the pc, wall charger or car charger, and will not sync. All I get on

  • Pages in ALV grid output and header on everypage

    Hi, My report output is displayed in a ALV grid. The output has around 100 records. Now , my requirement is to display the output in pages, say 25 records per page and I also want to have the header details for every page. How  can I do it? Thanks, S

  • How to send pdf files from local dir through emails attachments

    I have some pdf documents in some directory, I want to send those pdf's as an attachment throu emails to the concerned person. Please let me know how to attach the files and send through email. Thanks.

  • Configured Alert in RWB, but alert mails not coming in Alert Inbox

    Hi Experts, I have created an alert in alrtcatdef and set the rules in Alert Category However for the interface fialure, did not find any alert mail in RWB's alert inbox. Please suggest, where I ama missing. Regards Pankaj