Jump to content

This topic is 8293 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

i have a field in my database that is a calculation. it calculates the records number in the current found set by using the Status(CurrentRecordNumber) function. it is set to not store the result and calculate as needed.

on a results page on my website this field is displayed along with other information. it works perfectly when i only have one search parameter. however, when i have more than one search parameter it appears to still number the results as if i was only searching by the first parameter.

in other words, my results should also show 1, 2, 3, 4, 5, 6 etc.,

but instead these are results are showing something similar to 4,23,25,32,43,57

the strange thing is, when i go and look at the database where it is being hosted, the correct values appear for each record. but through the web i get the bizarre ones. any thoughts?

Posted

Can't say off-hand what the problem is with the calculation, but if all you need is to number the records in your found set from 1...n, then use the [FMP-CurrentRecordNumber] tag.

Posted

unfortunately, numbering is not all i need to do. i left details out for simplicity sake. but here goes:

i'm trying to get my results to wrap after each 3rd item. to do this i have a calculation field that generates one piece of html if the current record number is mod3 and a different piece if the current record number is not mod3.

that is why i cannot use [FMP-CurrentRecordNumber]

i'm reading on different ways to achieve this "wrapping" thing, but as i've already built it using this method and what i've done SHOULD work, i was hoping someone may have encountered this problem before and tell me how to fix it. thanks,

tim.

Posted

yup. i did. and as i said above, the calculation shows correctly on the database, but not through the web. i have since used a javascript solution to this problem, but it still seems worth looking into. i know that you've used this particular solution before, did you not have these problems with it?

Posted

Try this:

<table><tr>

<script>i = 1 ; nCols = 3 ;[FMP-Record]

if ((i % nCols) == 0)

{ document.write("<td>[FMP-CurrentRecordNumber] [FMP-Field:name]</td></tr><tr>") ; }

else

{ document.write("<td>[FMP-CurrentRecordNumber] [FMP-Field:name]</td>") ; } ;

i++ ;[/FMP-Record]

</script></tr></table>


or you could try this:
<table><tr>

<script>i = 1 ; nCols = 3 ;[FMP-Record]

if ((i % nCols) == 0)

{ document.write("<td>" + i + " [FMP-Field:name]</td></tr><tr>") ; }

else

{ document.write("<td>" + i + " [FMP-Field:name]</td>") ; } ;

i++ ;[/FMP-Record]

</script></tr></table>


Hope this helps.

Garry

This topic is 8293 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.