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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:15:03+00:00 2026-06-11T16:15:03+00:00

I asked this once before (see this thread ), but I’ve become stuck again,

  • 0

I asked this once before (see this thread), but I’ve become stuck again, and that code does not seem to work in another example.

The GUI now has two different picklists. stylabid and pjtlabid. If I click on one of them, I want any selected items in the other list to get cleared.

Here is the jquery code:

$('input[name="stylabid"]').change(
    function(){
      $('#pjtlabid').find('option').prop('selected',false)
    });

But this has no effect…does anyone see what’s wrong here?

TIA,
rixter
PS — Since some of you asked, here is the HTML code:

<div id=content-container2>
      <fieldset>
      <LEGEND><b>Select Study Sample</b></LEGEND>
    <p>
    <P CLASS=select_header>Study - Box - Well - Lab ID<br>
    <SELECT multiple size=20 NAME="stylabid" onchange=show_stylabid() onclick=clear_fetch() STYLE="width: 115px">
    <?php 
      $i=0;
      while ($i < $numstylabids) {
        $styarr = pg_fetch_row($stylabidresult);
        echo "<option value=$styarr[0]>$styarr[1]\n";
        $i++;           
      }
      ?>
    </select>
    </p>                
      </fieldset>
    </div>

and the second select list:

<fieldset>
      <LEGEND><b>Select Project Sample</b></LEGEND>
    <p>
    <P CLASS=select_header>Project - Box - Well - Lab ID<br>
    <SELECT multiple size=20 NAME="pjtlabid" onchange=show_pjtlabid() onclick=clear_fetch() STYLE="width: 115px">
    <?php 
      $j=0;
      while ($j < $numpjtlabids) {
        $pjtarr = pg_fetch_row($pjtlabidresult);
        echo "<option value=$pjtarr[0]>$pjtarr[1]\n";
        $j++;           
      }
      ?>
    </select>
    </p>                
      </fieldset>
  • 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-11T16:15:05+00:00Added an answer on June 11, 2026 at 4:15 pm

    The GUI now has two different picklists. stylabid and pjtlabid. If I click on one of them, I want any selected items in the other list to get cleared.

    If by picklist you mean a <select> element, the problem is how you bind your change handler: a <select> is not an <input>. Instead, do:

    $('select[name="stylabid"]').change( function() {
        $('#pjtlabid').find('option').prop('selected',false);
    });
    

    Also, be sure that you are using the right selectors; '#pjtlabid' selects the element whose ID is pjtlabid, while [name="stylabid"] selects the element whose name is stylabid. The name and ID attributes are not the same.

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

Sidebar

Related Questions

This has been asked once before but that didn't work for me at all.
This question has been asked more than once before, but I have not found
While I realize that this question has been asked once or twice ago but
I have asked this once before but i didnt get a very clear answer.
I had asked this question once before but has had 0 attention and the
I am sure this has been asked before but my google-fu was not able
This is probably a question that has been asked before, but I couldn't find
I guess this has been asked before but I can't find something that I
I know that this topic has been asked several times before but none of
Once again, sorry if this has been asked before and if its too specific

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.