Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8879957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:04:07+00:00 2026-06-14T20:04:07+00:00

How would I add another not equal (!=) value to this statement? if ($(this).data(increase_priority1)

  • 0

How would I add another not equal (!=) value to this statement?

if ($(this).data("increase_priority1") && $(this).val() != 1) 

I tried reversing the syntax at the beginning of the function which determines if it is equal, but that stopped it from removing items completely (including those not equaling 1)

if ($(this).data("increase_priority1") && $(this).val() != 1 && $(".complaint select").val() != "Too_small")

This function adds and/or remove values from “increase_priority1” when the user has selected both a complaint and ranked the importance level of the issue, and I need it to change the value (in this case what the complaint is) and importance level (i.e. increase_priority1) if either of those 2 fields changes. At the moment it only changes when the importance level changes.

The full function is:

var $increase_priority1 = $(".increase_priority1");
$('.ranking, .complaint select').dropkick({
change: function () {
    var name = $(this)
        .data("name"); //get priority name
    if ($(".complaint select")
        .val() === "Too_small" && $(this)
        .val() == 1 && !$(this)
        .data("increase_priority1")) {
        //rank is 1, and not yet added to priority list
        $("<option>", {
            text: name,
            val: name
        })
            .appendTo($increase_priority1);
        $(this)
            .data("increase_priority1", true); //flag as a priority item
    }
    if ($(this)
        .data("increase_priority1") && $(this)
        .val() != 1) {
        //is in priority list, but now demoted
        $("option[value=" + name + "]", $increase_priority1)
            .remove();
        $(this)
            .removeData("increase_priority1"); //no longer a priority item
    }
}
});

Fiddle which shows this in context: http://jsfiddle.net/chayacooper/vWLEn/132/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:04:08+00:00Added an answer on June 14, 2026 at 8:04 pm

    An OR-operation is true when at least one of the operands is true (possibly both!). Your statement should be:

    if ($(this).data("increase_priority1") && 
        ($(this).val() != 1 || $(".complaint select").val() != "Too_small")). 
    

    || is the Javascript-syntax for an OR.

    This will run the if if .data("increase_priority1") is true and $(this).val() != 1 or $(".complaint select").val() != "Too_small") is true.

    Note that the interpreter will stop if the first part of the && is false, that is to say: it will not even look at the second part. It is the same for the ||, but the other way around, so if the first part of the || is true it will not look at the second part.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would I add another element to be evaluated by value to this statement?
For my web-application I would like to add an object before another object inside
can I add a CCK image field to another CCK field ? I would
I'm using Elmah with ASP.NET and wondering how I would add custom data, such
This is my query as it is now. I want to add another column
Not all that sure how I would describe this question, so I'll jump right
How would I add another event to the pane created in our GUI manager
I'd like to write a gmail extension that would add a button on the
I thought every time you do a flash[:notice]=Message it would add it to the
I don't understand how using a 'challenge token' would add any sort of prevention:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.