Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

display results in columns

Featured Replies

does anyone have a good solution for displaying information in a grid format (3rows x 3 columns).

thanks

David

Hi Rivet!

what format/order exactly?

eg.

-----------------------

rec1 | rec4 | rec7

rec2 | rec5 | rec8

rec3 | rec6 | rec9

-------------------------

1st thing that comes to my mind is using nested tables...some JS perhaps....post the format u need and perhaps we make a solution!

All the best!

  • Author

------------------------

rec1 | rec2 | rec3

rec4 | rec5 | rec6

rec7 | rec8 | rec9

------------------------

Left to right is preferred. Thanks

  • 1 month later...

I am using the following javascript to display in columns but it only seems to work in IE. Both Netscape (4.7) and Safari just show a single row of records. Anyone have a cross-browser solution or a separate solution that works outside Explorer?

<HEAD>

<script language="javascript">

<!---

var count = 0

var howmany = 3

//

--->

</script>

</HEAD>

<BODY>

<TABLE><TR>

[FMP-RECORD]

<TD>

[FMP-FIELD: Fieldname]

</TD>

<script language="javascript">

count = count + 1

if (count == howmany)

{count = 0;

document.write("</tr><tr>");}

</script>

[/FMP-RECORD]

</TR>

</TABLE>

</BODY>

  • Author

I am using the mod function now.

[PostitionField]= Mod(Status(CurrentRecordNumber) - 1 ,9) + 1

This way the found set is number in multipule groups of 1-9 so when the page loads, your grid will have an if statement for each cell of your table.

This one works in Safari:

<HEAD>

<script language="javascript">

var count = 0

var howmany = 3

</script>

</HEAD>

<BODY>

<TABLE><TR>

<script language="javascript">

[FMP-RECORD]

document.write("<TD> [FMP-FIELD: name] </TD>");

count++;

if (count == 3)

{

count = 0;

document.write("</tr><tr>");

} ;

[/FMP-RECORD]

</script>

</TR>

</TABLE>

</BODY>

It worked when I removed the Comments from the Script in the <head>. So do that first and your script may work.

All the best.

Garry

Thanks for both the suggestions. I'm afraid Garry's javascript hasn't worked for me - in fact I get no records displayed at all, with or without comments in the <head>. I am intrigued as to why it worked on your version of Safari and not mine though ( I'm using version 1.0 (v85)).

I'll have a go with the mod function later to see if that does the trick.

Phil

I'm using 1.0 (v85).

What does the "View Source" look like?

Can you see values in the document.write statements?

How many times has the <script> content looped?

Do you have a ; at the end of appropriate lines?

Good Luck.

Garry

The source code appears to be fine: the script has looped the correct number of times (12 in my case) and is returning values for all my FMP fields, but nothing in the document.write sections is visible. Sounds like a misplaced ; or something wrong with my html actually. From:

<script language="javascript">

[FMP-RECORD]

document.write("<TD WIDTH="160" VALIGN=top BGCOLOR="#FFFFFF">

<A HREF="javascript:Popup('[FMP-LinkRecID:format=record_detail.htm, layout=websearch]')" title="Details"><IMG SRC="[FMP-image: PICTURE]" WIDTH=156 HEIGHT=156 BORDER=0>

</A>

<CAPTION ALIGN="bottom"> [FMP-FIELD: NUMBER]</CAPTION>

</TD>");

count++;

if (count == 4)

{

count = 0;

document.write("</tr><tr>");

} ;

[/FMP-RECORD]

the script is returning:

document.write("<TD WIDTH="160" VALIGN=top>

<IMG SRC="FMPro?-db=database.fp5&key=12595907&-img" WIDTH=156 HEIGHT=156 BORDER=0>

<CAPTION ALIGN="bottom">15655</CAPTION>

</TD>");

count++;

if (count == 4)

{

count = 0;

document.write("</tr><tr>");

} ;

Thanks for your help on this.

Phil

The quotes have been mixed-up. Try this:

document.write("<TD WIDTH='160' VALIGN=top BGCOLOR='#FFFFFF'>");

document.write("<A HREF="javascript:Popup('[FMP-LinkRecID:format=record_detail.htm, layout=websearch]')" title="Details">");

document.write("<IMG SRC="[FMP-image: PICTURE]" WIDTH=156 HEIGHT=156 BORDER=0></A><CAPTION ALIGN="bottom"> [FMP-FIELD: NUMBER]</CAPTION></TD>");

Hopefully that should sort the quotes out smile.gif

All the best.

Garry

Quotes all sorted - everything is now displaying as expected (although not in IE of course - I think this calls for some browser detection). Thanks for your help on this Garry

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.