Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    May 2010
    Location
    Sweden
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question CurrentRow MOD And Br

    hello I'm trying to get a loop. The idea is to just
    create a table that shows 2 row and 5 column.


    Instead of
    1
    2
    3
    4
    a.s.o


    I want
    12345
    space writable
    678910


    I've made a CurrentRow MOD and it working right to left, but
    not the space

    even if it is possible to loop the table instead of the columns


    Code:
    <table width="500" border="1">
    <tr><cfoutput query="testrec" startRow="#StartRow_testrec#" maxRows="#MaxRows_testrec#">
    <td>#testrec.tblOnskelista# </td>
    <CFIF testrec.CurrentRow MOD 5 IS 0>
     
    </TR>
    <TR></TR>
    </CFIF>
    </cfoutput>
    </table>

  • #2
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Code:
    <table width="500" border="1">
    <tr>
    <cfoutput query="testrec" startRow="#StartRow_testrec#" maxRows="#MaxRows_testrec#">
    <td>#testrec.tblOnskelista# </td>
    <CFIF testrec.CurrentRow MOD 5 IS 0>
    </tr>
    <tr><td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
    <tr>
    </CFIF>
    </cfoutput>
    </table>
    This _should_ give you the blank space in between. If you want to output data from another cfoutput, the outer cfoutput should use the group attribute and the inner cfoutput should surround only ONE td with the data inside the td.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #3
    New Coder
    Join Date
    May 2010
    Location
    Sweden
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts

    allmost :)

    it gives me the space between entries. I was looking for was more like this

    table 1
    [1][2][3][4][5]

    space to write in

    table 2
    [6][7][8][9][10]

  • #4
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Is "space to write in" a textarea? What are you thinking of?
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #5
    New Coder
    Join Date
    May 2010
    Location
    Sweden
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    yes.. like a text area

    This is an example of how I want it to look like

    the gallery.
    Last edited by theborg72; 06-01-2012 at 09:30 PM.

  • #6
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Code:
    <table width="500" border="1"> 
    <tr> 
    <cfoutput query="testrec" startRow="#StartRow_testrec#" maxRows="#MaxRows_testrec#"> 
      <td>#testrec.tblOnskelista# </td> 
      <CFIF testrec.CurrentRow MOD 5 IS 0> 
      </tr> 
      <tr>
        <td colspan="5"><textarea id="thisTextarea#testrec.CurrentRow#" name="thisTextarea#testrec.CurrentRow#"></textarea></td>
      </tr> 
      <tr> 
      </CFIF> 
    </cfoutput> 
    </table>
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #7
    New Coder
    Join Date
    May 2010
    Location
    Sweden
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    But now it's the same on both fields. The clone what you write and it becomes equal on the bottom. it'll just be text between these two lines. not under

  • #8
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    The code will place a textarea after every 5 records (per your modulus equation). If you are returning 10 records, there will be 5 records, then a textarea, then five records, then a textarea. If you are returning only 9 records, only one textarea will be placed. If you do not want more than one textarea, then you can modify the conditional to include "AND testrec.Currentrow eq 5" so that a textarea will ONLY be placed after the fifth record, and no more.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #9
    New Coder
    Join Date
    May 2010
    Location
    Sweden
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by WolfShade View Post
    The code will place a textarea after every 5 records (per your modulus equation). If you are returning 10 records, there will be 5 records, then a textarea, then five records, then a textarea. If you are returning only 9 records, only one textarea will be placed. If you do not want more than one textarea, then you can modify the conditional to include "AND testrec.Currentrow eq 5" so that a textarea will ONLY be placed after the fifth record, and no more.
    it works perfectly on the 10 first. but then when you take the next 10 the script dont work.

  • #10
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    <CFIF testrec.CurrentRow MOD 5 EQ 0 AND testrec.CurrentRow MOD 10 NEQ 0>
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • Users who have thanked WolfShade for this post:

    theborg72 (06-01-2012)

  • #11
    New Coder
    Join Date
    May 2010
    Location
    Sweden
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by WolfShade View Post
    <CFIF testrec.CurrentRow MOD 5 EQ 0 AND testrec.CurrentRow MOD 10 NEQ 0>
    YES thats it..

    I do not know how I can thank you. that's exactly what I was looking for. Thank you very much.

  • #12
    New Coder
    Join Date
    May 2010
    Location
    Sweden
    Posts
    15
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Just a quick question how do I do if there are not 10 then disappears text field tried me on a <cfelse> and add the field. but it does not work


  •  

    Posting Permissions

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