?
Solved

unselect multi select

Posted on 2014-07-15
4
Medium Priority
?
319 Views
Last Modified: 2014-07-15
Hi,

I have a multi select box that I want when the user click on the radio button it will unselect the items from the box.

this is what I have:

<label style="display: inline-block;margin-bottom: 5px;" title="Generate this report by Name" onclick="ClearSelection();">
                        <input type="radio" name="CategoryType" checked id="CategoryType" value="Name"/>
                      Name</label>


<select name="SelectName" id="SelectName" style="width: 230px; height: 100px;" multiple="">
 <OPTION value=646655>smith, joe- (646655)</OPTION> 
<OPTION selected value=6543334>knighty, Mighty- (6543334)</OPTION> 
</select>

function ClearSelection();
{

//Here I want to say if they are selected then unselect them. 
   $("#SelectName option").prop("selected", false);
}

Open in new window

0
Comment
Question by:lulu50
  • 2
  • 2
4 Comments
 
LVL 21

Accepted Solution

by:
Randy Poole earned 2000 total points
ID: 40197205
$("#SelectName").find("option").attr("selected", false);
0
 

Author Comment

by:lulu50
ID: 40197303
Thank you Randy!!!!!!!!
0
 

Author Closing Comment

by:lulu50
ID: 40197305
Thank you
0
 
LVL 21

Expert Comment

by:Randy Poole
ID: 40197306
Anytime :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question