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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:17:51+00:00 2026-05-13T20:17:51+00:00

I have a form that uses jQuery-UI’s selectable plugin to populate a list from

  • 0

I have a form that uses jQuery-UI’s selectable plugin to populate a list from a table. My form also allows users to remove single or multiple list items if they change their minds. This function works in IE and Firefox. The list is also automatically cleared and the form reset if the user chooses to download their list. This also works in IE and Firefox.

Lastly, I added a button that removes all the list items and resets the form if the user wants to start from fresh. This function only works in Firefox. In IE, the list items are removed from the field they are in, but for some reason $('#newgroups').removeData() is ignored. I know this because after .remove or .tofile I can add a group that has the same name as an earlier but no longer present group. After .clear, though the form looks the same, creating a list item with a previously used group name fails.

Here is the code (I’ve left out function bodies that aren’t involved with removing list items or resetting the form):

$(function(){
    $('#selectable').selectable({
         //rules for how table elements can be selected
    });

    $("input[name='makegroup']").live("click", function(event){
        //adding list items
    });

    $("input[name='removegroup']").live("click", function(event){
        event.preventDefault();
        groups.msg();
        groups.remove(); //works in FF and IE
    }); 

    $("input[name='cleargroups']").live("click", function(event){
        event.preventDefault();
        groups.msg();
        return groups.clear(); //partially fails in IE
    });

    $("form#grouper").submit(function(){
        return groups.tofile(); //works in FF and IE
    });

    groups={
        grpmsg: $('#grpmsg'),
        grpselections: $('#newgroups'),
        grpname: $("input[name='newgroup']"),
        filetext: $("input[name='filetext']"),

        add: function(){
            //add option to this.grpselections and set this.grpselections.data
            //compares input data to $grpselections.data() for problems and throws error if necessary               
        },

        remove: function(){
            var vals= this.grpselections.val();//selected list items
            for(var i in vals){
                this.grpselections.data(vals[i]).removeClass('ui-selected chosen');
                this.grpselections.removeData(vals[i]);
            }
            this.grpselections.find(':selected').remove();
            this.grpname.focus();
        },

        clear: function(){ //identical to tofile method of resetting form
            this.grpselections.empty();
            this.grpselections.removeData();//DOES NOT WORK IN IE
            $('#selectable td').removeClass('ui-selected chosen');
            this.grpname.focus();
            return true;
        },  

        tofile: function(){
            this.grpselections.select();
            var gtxt='';
            this.grpselections.find('option').each(function(i){
                gtxt += $(this).text() + "\n";
            });
            if (gtxt.length === 0) {
                this.msg('nonetofile');
                return false;
            }
            this.filetext.val(gtxt);

            //BELOW IS IDENTICAL TO clear function EXCEPT IT WORKS IN IE TOO
            this.grpselections.empty();
            this.grpselections.removeData();
            $('#selectable td').removeClass('ui-selected chosen');
            this.grpname.focus();
            return true;
            //END INTERESTING BIT
        },

        msg: function(msgtype){
                //show error message specific to problem
    },

        addline: function(groupname){
            //auxilliary to add function                
        }
    };

});
  • 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-05-13T20:17:51+00:00Added an answer on May 13, 2026 at 8:17 pm

    Well first to confess I have not used the selectable stuff at all, SO given that, a shot in the dark, can you chain?

    this.grpselections.empty().removeData();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that uses the excellent jQuery validation plugin. This is a
I have a form that uses JQuery Validate plugin to validate the data. For
I have a form that uses jquery to generate rows of input fields these
I have a method set up that uses jquery form for a file upload
I have a form select replacement that uses jQuery to show options in a
I have a form that uses jquery form validator : My question is how
I have a form with an auto-complete field that uses jQuery Tokeninput . The
I have a simple form that uses jQuery validation to notify the user of
I have a form that uses jQuery Validate. You click the Submit button, form
I have a form that uses jQuery to submit an ajax post and it

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.