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.

Reading a record in a table to display more fields

Featured Replies

I have created a table using CDML. The table lists the records in my database by rows. Each row contains several fields.

How do I embed a button in each row, that when pressed, will select the chosen record, and display more fields of that record in another webpage?

I know how to embed the button, but I dont know how to get it to "read" the proper record and display more of it. I have cut and pasted the code for you to see:

When I press the button, as it is now, it shows a blank screen:

<!--The following CDML code displays a row for each record. -->

<tr>

<td width="140" height="63">

<!--The form provides the information needed to process the action of "view more details". -db calls the appropriate database, -format calls the html page, -token sets and carries the token,-lay calls the layout in the database. -->

<FORM Method="POST" ACTION="FMPro">

<INPUT TYPE="hidden" NAME="-db" VALUE="mydatabase.fp5">

<INPUT TYPE="hidden" NAME="-format" VALUE="moredetail.html">

<INPUT TYPE="hidden" NAME="-token" VALUE="[FMP-currenttoken]">

<INPUT TYPE="hidden" NAME="-lay" VALUE="web">

<INPUT TYPE="hidden" NAME="class_id" VALUE="[FMP-field: class_id]">

<INPUT TYPE="hidden" NAME="order_no" VALUE="[FMP-currenttoken]">

<INPUT TYPE="hidden" NAME="qty" VALUE="1">

<INPUT TYPE="image" src="images/viewdetail.jpg" width="105" height="25" NAME="-view">

</FORM>

<!--The [FMP-field]tag calls the specified field in the current database -->

</td>

<td width="140" height="63">[FMP-Field: class_id]</td>

<td width="140" height="63">[FMP-Field: class_name]</td>

<td width="140" height="63">[FMP-Field: class_description]</td>

<td width="140" height="63">[FMP-Field: class_date]</td>

<td width="139" height="63">[FMP-Field: class_cost]</td>

</tr>

[/FMP-Record]

</table>

You can use the [FMP-LinkRecID] tag to achieve this as a URL. Alternatively, you can use a little bit of Javascript to do this as a form submission. I ususally use the Javascript method because I believe it is a bit neater.

The cdml method would look like this:

<a href="[FMP-LinkRecID: format=moredetail.htm]" target="_blank">More detail</a>
You would place this in each row of the table.

For the Javascript method you would create a function which submits the form. This function would have the RecID passed to it so that it can be assigned to the "-recid" element of the form.

Hope this helps.

Garry

p.s. Use "-find", not "-view" in your form.

Am I to assume that you actually have a tag [fmp-record]? It was not in the copy/paste. Yet the [/fmp-record] is there.

  • Author

Thanks Garry!!!! That worked like a charm!!!!!!!!

Lance

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.