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 8927467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:13:35+00:00 2026-06-15T08:13:35+00:00

In the below script I added or operator to check the condition, Like if

  • 0

In the below script I added or operator to check the condition, Like if it is “ALL TCP” or “ALL UDP” item must get disabled, Please suggest me to modify the code.

<script type="text/javascript">
    function chgJob(pThis, pRow)
    {
        if ((pThis.value != 'All TCP') || (pThis.value != 'All UDP'))
        {
            $x_disableItem('f02_' + pRow, false);
        }
        else
        {
            $x_disableItem('f02_' + pRow, true);
        }
    }
</script>
  • 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-15T08:13:36+00:00Added an answer on June 15, 2026 at 8:13 am

    A string can never be equal to 'All TCP' and equal to 'All UDP' at the same time, so the condition will always be true.

    You want to use the && operator instead of the || operator:

    if ((pThis.value != 'All TCP') && (pThis.value != 'All UDP'))
    

    Edit:

    As Cerbrus pointed out, you don’t need the if statement at all, you can use the boolean expression directly by inverting it (x==y || x==z is the same as !(x!=y && x!=z)):

    <script type="text/javascript">
    function chgJob(pThis, pRow) {
        $x_disableItem('f02_' + pRow, pThis.value == 'All TCP' || pThis.value == 'All UDP');
    }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below script break the sequence at every 'E' and subsequently an 'E' is added
i made a php script as below ran it and ouput is Record Added
In the script below, I need to add an item None with value of
Please refer to the example below. Two subplots are added, and to each a
update I added these two lines to the script below: I ran the debugger
I have tested the below script on a demo page which is not using
I've tried the below script but I am getting an error: dim cn, rs
i am trying to run the below script SELECT field_value FROM jos_js_res_record_values jrv INNER
How would I change the below script to edit the original file instead of
I'm using ajax login script in my store, so i'm using below script to

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.