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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:11:22+00:00 2026-06-13T06:11:22+00:00

i have this accordion with only one title, that will show an document name

  • 0

i have this accordion with only one title, that will show an document name and number, if you click on the title, the accordion opens and shows like a detail page of the document, now what i want to ask is.
each user that logs into the mobile app, will have a different amounts of documents connected to the username… now what i need is how to get that one accordion to copy itself for the X amount of documents loaded by the webservice. i need this in javascript because what i am using is :
-visual studio express for windows phone/HTML5/CSS/Javascript.
all the tutorials show a for loop that creates a new for the data, but i allready have a div(accordion) all i need is to get it loaded lest say 10 times just to see if it works, and then enter fake data into the input field

HTML for accrodion

    <div id="AccordionContainer" class="AccordionContainer">
<div onclick="runAccordion(1)">
  <div class="Accordiontitle" onselectstart="return false;">
    <a>
      <input class="AccordionLink" type="button" href="ItemPages.html" id="docname"/>
    </a>
    <br/>
    <a id="POnumber"></a>
  </div>
</div>
<div id="Accordion1Content" class="AccordionContent" style="background-color:white; color:grey;">
  <form>
    <p>
      <label for="create" >Created by :</label>
      <input type="text" style="margin-left:60px;" readonly="readonly" DISABLED="DISABLED" size="22" id="create"/>
    </p>
    <p>
      <label for="createdate" >Created Date :</label>
      <input type="text" style="margin-left:43px;" readonly="readonly" DISABLED="DISABLED" size="22" id="createdate"/>
    </p>
    <p>
      <label for="process" >Process name :</label>
      <input type="text" style="margin-left:36px;" readonly="readonly" DISABLED="DISABLED" size="22" id="process"/>
    </p>
    <p>
      <label for="transtype">Transaction type :</label>
      <input type="text" style="margin-left:20px;" readonly="readonly" DISABLED="DISABLED" size="22" id="transtype"/>
    </p>
    <p>
      <label for="lastact">Last action :</label>
      <input type="text" style="margin-left:61px;" readonly="readonly" DISABLED="DISABLED" size="22" id="lastact"/>
    </p>
    <p>
      <label for="lastuser">Last user :</label>
      <input type="text" style="margin-left:73px;" readonly="readonly" DISABLED="DISABLED" size="22" id="lastuser"/>
    </p>
    <p>
      <label for="lastupd">Last update :</label>
      <input type="text" style="margin-left:55px;" readonly="readonly" DISABLED="DISABLED" size="22" id="lastupd"/>
    </p>
    <p>
      <label for="duration">Duration :</label>
      <input type="text" style="margin-left:78px;" readonly="readonly" DISABLED="DISABLED" size="22" id="duration"/>
    </p>
    <p>
      <label for="saved">Saved :</label>
      <input type="text" style="margin-left:93px;" readonly="readonly" DISABLED="DISABLED" size="22" id="saved"/>
    </p>
    <p>
      <label for="adhoc">Ad hoc user :</label>
      <input type="text" style="margin-left:53px;" readonly="readonly" DISABLED="DISABLED" size="22" id="adhoc"/>
    </p>
  </form>
</div>
</div>

even proper links to sites will work aswell 🙂
thnx

  • 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-13T06:11:23+00:00Added an answer on June 13, 2026 at 6:11 am

    I guess this is the first step…

    /* a helper method */
    
    function getElsByClassName(classname, container){
        var rv = [];
        container = container || document;
    
        var elems  = container.getElementsByTagName('*')
        if (elems.length){
            for (var x in elems ){
                if (elems[x] && elems[x].className && elems[x].className == classname){
                    rv.push(elems[x]);
                }
            }
        }
        return rv; 
    }
    
    /* the code */
    var accordions = document.getElementById("accordions"),
        accordion = getElsByClassName("AccordionContainer")[0],
        numberOfAcc = 10;
    
    for(var i = 0; i< numberOfAcc; i++){
        var obj = accordion.cloneNode(true),
            btn = getElsByClassName("runAccordionButton", obj)[0];
        /* here you can attach on click handlers and set values using javascript */
       btn.onclick = function() {
          alert('clicked It');
          //here goes the logic
       };
    
        //setting values
       var creator = getElsByClassName('create',obj)[0]
       creator.value = 'John Do the ' + i + 'th';  
    
    
        //add it to the container       
        accordions.appendChild(obj);
    }
    
    
    
    ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built this accordion using the jquery ui accordion plugin, I sort of
I have this expression accordionMain_i0_accordion_i0_ctl01_0_ddl_xxxxxxxx_iy_tblItem where xxx can contain also '_' and its number
I am using JQuery Accordion. I have this page here: http://www.hauppauge.com/site/support/support_colossus.html#tabs-6 What happens is
I have two updatepanels inside an accordion control, laid out like this: <accordion> <first
Soon I'll be working on catalog(php+mysql) that will have multilang content support. And now
I have an accordion that when the page loads all the accordions are collapsed,
I have a form. This form submits via POST to an iframe, that, in
Imagine that in one data template, I have a textBox, and another data template,
I have a simple accordion type mechanism that I've been working on. I am
I'm having trouble explaining this but here it goes: I have a custom accordion

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.