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

  • Home
  • SEARCH
  • 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 8367845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:15:23+00:00 2026-06-09T13:15:23+00:00

I want to check if my application’s buttons are pressed or not. The error

  • 0

I want to check if my application’s buttons are pressed or not. The error I face is, even when the buttons are clicked all the alerts display. Attached is the code snippet, the variables are set by click of buttons.

I want the alert not to display if any of the values are selected,

var condition ; 
var clickable;     // GLOBAL VARIABLES

function clickMe1() 
{
    clickable = "Sell";
}

function clickMe2() 
{
    clickable = "Rent";
}

function condition1()
{
    condition="Excellent"
}

function condition2()
{
    condition="Good"
}

function condition3()
{
    condition="Fair"
}

function condition4()
{
    condition="New"
}



function display()    
{
    if (condition != "Excellent"||"New"||"Fair"||"Good")
    {
        alert( " Please enter the condition ");
    }
    if (clickable != "Sell"||"Rent")
    {
        alert("Please enter the Sell");
    }
    if (costSell === '')  
    {
        alert("Please select a Price ");
    }
    if ((condition === "Excellent"||"New"||"Fair"||"Good") && (clickable === "Selling"||"leasing")&&(!isNaN(costSell)))
    {
        // Do Something
    },
    error: function(data){
        console.log("not added");
    }
    });
    }
    else
    {
        alert(" price is not a number"); 
    }
}

I also tried:

if(condition !='Excellent'|| condition!='New' || condition!='Fair'|| condition!='Good')
{
    alert( " Please enter the condition ");
}
if (clickable !='Sell'||'Rent' )
{
    alert("Please enter the Sell ");
  • 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-09T13:15:24+00:00Added an answer on June 9, 2026 at 1:15 pm

    if(condition !='Excellent'|| condition!='New' || condition!='Fair'|| condition!='Good')

    should be

    if (condition != 'Excellent' && condition != 'New' && condition != 'Fair' && condition != 'Good')​

    because your version triggers if the condition is any one of Excellent, New, Fair, or Good. The corrected line triggers when the condition is not one of those.

    And

    if (clickable !='Sell'||'Rent' )

    should be

    if (clickable !='Sell' && clickable !='Rent' )

    because you can’t make that shortcut of only using clickable once.

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

Sidebar

Related Questions

I want to check whether servers are active or not from the iphone application
I want to check device id for my iPhone simulator application. But not using
i want to check internet connection in my application.but, its not displaying properly. i
I want to check in my application programmatically if user shutdown/restart/logoff the computer. I
I have a Inno Setup project that I want to check if the application
I want to check for user inactivity in my application. I did a little
I want to check if the window of an external application has the vertical
for some reason I want to check how the deadlock occurred in web application
I'm developing an application in which I want to check like to which power
I have an application that passes in java.util.Date. I want to check whether this

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.