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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:20:59+00:00 2026-06-17T09:20:59+00:00

I have a two checkboxes as follows: <input type=checkbox name=options_v[] id=you_pick_v value=you_pick /> <input

  • 0

I have a two checkboxes as follows:

<input type="checkbox" name="options_v[]" id="you_pick_v" value="you_pick" />
<input type="checkbox" name="options_v[]" id="owner_picks_v" value="owner_picks" />

I want my javascript function to make another element grey if the boxes are unchecked and black if either box is checked. For some reason, when I try to use “and” or “or” in the if/else statement, my html editor is showing that there is a problem. Am I not allowed to use these comparison operators in javascript? If so, what might you suggest? Sorry if anything that I’m writing is ambiguous.

Here is my javascript function:

$(document).ready(function() {
   $('#you_pick_v, #owner_picks_v')
    .click(function(){
        var ypv = $('#owner_picks_v').is(':checked');
        var opv = $('#owner_picks_v').is(':checked');

    if(ypv == true and opv == true) {
            alert('both checked');

    }
  • 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-17T09:21:00+00:00Added an answer on June 17, 2026 at 9:21 am

    You need to use && instead of and, then || instead of or. This is JavaScript.

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

Sidebar

Related Questions

I have two checkboxes with different names: <input type=checkbox name=checkbox1 value=checkbox1> <input type=checkbox name=checkbox2
Please see coments in js code. I have two checkboxes <input type=checkbox name=first id=first
I have two checkboxes in my code as mentioned below: <input type=checkbox id=event_id name=data[Noncompetitor][event_id][]
I have HTML in the following form: <div id=filters> <ul> <li><label class=checkbox><input type=checkbox value=
I have two CheckBoxes and a TextBox. I want to TextBox to have IsEnabled=False
Here is my code, I have two checkboxes and want to keep one disabled
I have two checkboxes A and B. I want B to be disabled when
I have written code for two checkboxes: string sdate= Convert.ToDateTime(txtFromDate.Value); string edate=Convert.ToDateTime(txtEndDate.Value); I am
i have 5 checkboxes in my vb.net webform i want when two checkboxes are
I am looping through a bunch of array type fields. I have two checkboxes

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.