#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2012
    Posts
    14
    Rep Power
    0

    Question Printing in a specific div based upon a Id


    Hi all,
    I am printing content dynamically into some div's based upon a criteria...Those div's are already defined in HTML and I am inserting the code into them through VBScript. SO I need to put some data into different div's based upon a criteria. So, when I am trying to print the content into an already defined Div with a specific ID its creating a new Id. So I am not sure of how to tell the code to print in a specific Id. I am posting here my code for your reference
    <div class="div-table-row">
    <div class="div-table-col-large-elec" id="x"></div>
    <div class="div-table-col-small-large-elec" id="y"></div>
    <div class="div-table-col-small-large-elec" id="w"></div>
    <div class="div-table-col-small-large-elec-right-corner" id="z"></div>

    <%
    dim a(10),b(10)
    a(0)=1
    a(1)=2
    a(2)=3
    a(3)=4
    a(4)=5
    b(0)=6
    b(1)=7
    b(2)=8
    b(3)=9
    b(4)=10
    Response.write "<div class=""div-table-col-large-elec"" id=""x"">"
    for i=1 to UBound(a)
    if(a(i)<>"") then
    if(a(i)=2 or a(i)=3) then
    response.write a(i)
    response.write"<div class=""div-table-col-small-large-elec"" id=""y"">"&b(i)&"<br>"
    response.write"<div class=""div-table-col-small-large-elec"" id=""w"">"&b(i)&"<br>"
    response.write"<div class=""div-table-col-small-large-elec-right-corner"" id=""z"">"&b(i)&"<br>"
    end if
    end if
    next
    Response.write "</div>"
    Response.write "</div>"
    Response.write "</div>"
    Response.write "</div>"


    I need to print into above defined HTML div's and then finally close them ....As you can see, I need to print in one div(x) and based upon the entry present in the div x I need to print some other data in another div(y and z) but they should be closed only on end of loop so that the array is completely processed...
    But the code is creating a new div everytime...
    can anyone pls tell me how to print the content to an already defined div?
    Thanks,
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,581
    Rep Power
    278
    I'm not sure what you are trying to achieve, but you define div's on top of you code and it is html, so it is send to browser as is... after that in asp code you use response.write values from array and, but response.write create html code which goes to browser, so as result you have
    <div class="div-table-col-large-elec" id="x"></div> from first part and <div class="div-table-col-large-elec" id="x"> from response.write and the creates second div with the same ID....
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree

Similar Threads

  1. Record Count based on a specific field ID
    By UKFlyer in forum ASP Development
    Replies: 2
    Last Post: June 18th, 2011, 06:17 AM
  2. Generating a Query based on specific data
    By tcsikany in forum Microsoft Access Help
    Replies: 6
    Last Post: May 19th, 2010, 02:53 PM
  3. Printing letters to specific people through Access
    By ddennis in forum Microsoft Access Help
    Replies: 3
    Last Post: February 25th, 2005, 09:09 AM
  4. Printing to Specific Printer
    By solepixel in forum Microsoft Access Help
    Replies: 4
    Last Post: October 14th, 2004, 10:26 AM
  5. Open subform based on specific criteria
    By keg03009 in forum Microsoft Access Help
    Replies: 3
    Last Post: July 2nd, 2004, 10:22 AM

IMN logo majestic logo threadwatch logo seochat tools logo