SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast pravatr's Avatar
    Join Date
    Feb 2007
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question how to convert arraylist of objects to javascript array

    i am getting list of items.i want to store those items in Javascript array like
    var propertyIds = [103409, 44693, 38458];

    ----------------------------------------------------------

    var arr =document.getElementsByName("dealslist")[0].value;

    alert("arry-->"+arr);
    var propertyIds=new array();
    alert("arry-23->"+propertyIds);
    alert("arry-23->"+propertyIds.length);

    var propertyIds = [103409, 44693, 38458];

  2. #2
    SitePoint Enthusiast TriLLi's Avatar
    Join Date
    Feb 2010
    Location
    BiH, Bugojno
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    like this
    Code:
    var elements = document.getElementsByName('name');
    var data = Array();
    for(var i = 0; i < elements.length; i++)
    {
      data.push(elements[i].value);
    }
    http://www.wiseblog.info
    Programmers don't die, they just GO SUB without return.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •