Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > ColdFusion

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-01-2012, 11:20 AM   PM User | #1
theborg72
New Coder

 
Join Date: May 2010
Location: Sweden
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
theborg72 is an unknown quantity at this point
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>
theborg72 is offline   Reply With Quote
Old 06-01-2012, 01:36 PM   PM User | #2
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 951
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
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".
WolfShade is online now   Reply With Quote
Old 06-01-2012, 01:46 PM   PM User | #3
theborg72
New Coder

 
Join Date: May 2010
Location: Sweden
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
theborg72 is an unknown quantity at this point
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]
theborg72 is offline   Reply With Quote
Old 06-01-2012, 05:12 PM   PM User | #4
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 951
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
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".
WolfShade is online now   Reply With Quote
Old 06-01-2012, 05:48 PM   PM User | #5
theborg72
New Coder

 
Join Date: May 2010
Location: Sweden
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
theborg72 is an unknown quantity at this point
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 08:30 PM..
theborg72 is offline   Reply With Quote
Old 06-01-2012, 05:52 PM   PM User | #6
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 951
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
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".
WolfShade is online now   Reply With Quote
Old 06-01-2012, 06:14 PM   PM User | #7
theborg72
New Coder

 
Join Date: May 2010
Location: Sweden
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
theborg72 is an unknown quantity at this point
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
theborg72 is offline   Reply With Quote
Old 06-01-2012, 06:35 PM   PM User | #8
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 951
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
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".
WolfShade is online now   Reply With Quote
Old 06-01-2012, 07:23 PM   PM User | #9
theborg72
New Coder

 
Join Date: May 2010
Location: Sweden
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
theborg72 is an unknown quantity at this point
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.
theborg72 is offline   Reply With Quote
Old 06-01-2012, 07:26 PM   PM User | #10
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 951
Thanks: 7
Thanked 98 Times in 98 Posts
WolfShade is an unknown quantity at this point
<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".
WolfShade is online now   Reply With Quote
Users who have thanked WolfShade for this post:
theborg72 (06-01-2012)
Old 06-01-2012, 07:38 PM   PM User | #11
theborg72
New Coder

 
Join Date: May 2010
Location: Sweden
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
theborg72 is an unknown quantity at this point
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.
theborg72 is offline   Reply With Quote
Old 06-01-2012, 08:01 PM   PM User | #12
theborg72
New Coder

 
Join Date: May 2010
Location: Sweden
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
theborg72 is an unknown quantity at this point
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
theborg72 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:19 PM.


Advertisement
Log in to turn off these ads.