This topic is locked
[SOLVED]

 Insert button on each row of a list page

9/7/2011 11:06:32 AM
PHPRunner General questions
T
text author

I have a list page from a table. I want to be able to insert a button on each row that when clicked on will take some of the information in the row and insert it into another table.
I'm confused from a search of the forum as to whether this actually possible.
I'd appreciate some assistance on how to go about doing this.
Thanks very much
Richard

Sergey Kornilov admin 9/7/2011

Set 'View as' type of one of fields to 'Custom' and output the button code there. Something like this.

$value = "<SPAN class=buttonborder><INPUT class=button value='Do something' type=button onclick='somefunction()'></SPAN>";


In your code you can access any field value as $data["FieldName"] and pass parameters to somefunction() which is your Javascript function that does some job.
Similar approach is explained in this post:

http://www.asprunner.com/forums/topic/17701-javascript-onload-event/pageviewfindpostp60663

T
text author 9/7/2011



Set 'View as' type of one of fields to 'Custom' and output the button code there. Something like this.

$value = "<SPAN class=buttonborder><INPUT class=button value='Do something' type=button onclick='somefunction()'></SPAN>";


In your code you can access any field value as $data["FieldName"] and pass parameters to somefunction() which is your Javascript function that does some job.
Similar approach is explained in this post:

http://www.asprunner.com/forums/topic/17701-javascript-onload-event/pageviewfindpostp60663


Thanks v much Sergey