May 19, 200223 yr 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>
May 19, 200223 yr 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.
May 20, 200223 yr 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.
Create an account or sign in to comment