This topic is locked

Button to call a PHP script

1/3/2012 7:57:56 AM
PHPRunner General questions
T
taumic author

Hello,

I have this question: I want to build a button in the list page (on every row) which call a php script.

    • in ListPage:After Record Processed i declare my key-field ==> $record["rg_link"]=$data["RGK_NR"] ;


    • in Visual Editor I insert a button(right mouse - insert button), in the client before ==> onclick="window.location.href='mt_pdf_rechnungen/mt_rechnung.php?id={$rg_link}';"



  • the button is viewable, but on click - nothing happens ==> what is wrong?
    Alternative:

    • in ListPage:After Record Processed i declare my key-field ==> $record["rg_link"]=$data["RGK_NR"] ;


    • in VisualEditor/HTML-Mode ==> <TD>&nbsp;<INPUT onclick="window.location.href='mt_pdf_rechnungen/mt_rechnung.php?id={$rg_link}';" value=PDF type=button></TD>



  • the button is viewable and the PHP-script runs perfect, but I would like to work with the PHPR-options (INSERT-BUTTON) - see above.
    Many thanks for your help and a happy new year !!!
    Michael

T
taumic author 1/6/2012

No one can help ?
Sorry
Michael

Admin 1/6/2012

You cannot use template variables in Javascript code. For this specific job 'View as' type 'Custom' works the best.
Check this article for more info and examples:

http://xlinesoft.com/blog/2011/04/28/taming-the-beast-events-buttons-and-code-snippets/