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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:05:35+00:00 2026-06-10T01:05:35+00:00

console.log(jQuery(#tickets-expanded input:checkbox[name=’ids[]’]:checked)); jQuery(#tickets-expanded input:checkbox[name=’ids[]’]:checked).each(function() { selected.push(jQuery(this).val()); }); alert(selected); jQuery(#ids).val(selected); This is my code. Selected

  • 0
 console.log(jQuery("#tickets-expanded input:checkbox[name='ids[]']:checked"));
        jQuery("#tickets-expanded input:checkbox[name='ids[]']:checked").each(function() {
           selected.push(jQuery(this).val());
        });
        alert(selected);

        jQuery("#ids").val(selected);

This is my code. Selected array contains elements in the format “2,1”. I want it to be [“2″,”1”]. What should I do?

  • 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-10T01:05:36+00:00Added an answer on June 10, 2026 at 1:05 am

    Consider the code:

    var a = "item1,item2,item3";
    
    a = a.split(",");
    
    console.log( a );
    

    Output will be:

    ["item1","item2","item3"]
    

    Now you can apply this technique on your code at the end. The string you are getting can be split and you will get the array.

    Edit: You have multiple id elements? So you can also split data among them. Each will contain a value

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

Sidebar

Related Questions

Here is my jquery code: $('input').click(function(){ $('h1').empty().queue(function(){ console.log('queue'); }); }); }); Only the first
I am trying to get the JQuery Token Input prepopulated. var assignUserJson=$('#assignUserJson').val(); console.log(assignUserJson); //[{id:1,name:Andrew},{id:3,name:John}]
I'm using jQuery to capture an event: $('input').focus(function(e){ console.log( e.pageX, e.pageY ); }); This
jQuery(#surface).bind(mousedown, function(e) { console.log((x,y) = ( + e.pageX + , + e.pageY +)); });
I can't find any solution to get this jquery events to work. $(window).one('click',function(){ console.log('hide
this is my code: function(id) { id=$.fn.yiiGridView.getSelection(id); console.log(id); jQuery.ajax({ 'url':'/index.php?r=client/loadOne', 'data':id, 'cache':false, 'success':function(html){jQuery( .portlet-60
The code is: $function readyFin(jQuery() { console.log('ready!'); } $(document).ready(readyFin); If you can think of
Why does this: jQuery(document).ready(function($) { console.log(test); }); produce this error message: console is not
(function ($) { $.fn.test = function () { console.log('works'); }; })(jQuery); $(document).ready(function () {
I am making an ajax call in jquery $.get(validate_isbn.php, {isbn: obj[16]}, function(answer) { console.log(answer);

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.