Categories > TinyButStrong general >

Link or Button In Each Table Row

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Keith Silva
Date: 2006-12-06
Time: 19:52

Link or Button In Each Table Row

I am populating an HTML table with TBS in the common way with each table row containing data from a record in a database. Each row contains that record's id field. At the right end of each table row, I would like to have a button or link labeled [Edit] that when clicked opens an HTML window with a form containing the data from the originating table row.

This is a common design, but I am having difficulty determining how to implement this using TBS. Specifically, how do I detect the value of the id field to pass back to the server? I have checked the example and searched this Forum for help, but I have not found anything. The few examples I have found with Google searches involve a lot of PHP code embeded in an HTML page, so a PHP variable for the id field was readily available to send to the server.

Could someone please give me a lead to a Forum message or TBS feature that I would use for this? I don't need a very detailed description. If someone can point me in the right direction, I will do the needed homework.

Thanks, Keith Silva
By: TomH
Date: 2006-12-06
Time: 20:44

Re: Link or Button In Each Table Row

You need to decide what unique field is to be used in the linked edit query then construct the HTML link to pass the var name and value through - like you said very std stuff.

Maybe it would be a lot more helpful for us if you'd include you php query code and the template HTML for the row in question.

By: Trent
Date: 2006-12-06
Time: 20:59

Re: Link or Button In Each Table Row

Just enter this snippet below somewhere into your table structure.

<A href="edit.php?id=[blk.record_id]">Edit</A>

blk = your block
record_id = name of your record id field in your table
edit.php = the name of the page you want to open

By: Keith Silva
Date: 2006-12-06
Time: 21:34

Re: Link or Button In Each Table Row

Thank you very much. I understand your instructions and really appreciate your time and help here.

Thanks, Keith Silva