Jump to content

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

Recommended Posts

Posted

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

thanks

David

Posted

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!

Posted

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

rec1 | rec2 | rec3

rec4 | rec5 | rec6

rec7 | rec8 | rec9

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

Left to right is preferred. Thanks

  • 1 month later...
Posted

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>

Posted

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.

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

This topic is 7792 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.