This topic is locked
[SOLVED]

 Buttons on list page

2/25/2015 10:01:02 AM
PHPRunner General questions
G
g_parry author

Please help, I've spent most of the day trying to get this to work, What I need to do is

Click a button on the list page

This redirects to an add page for a different table and pre-populates two fields

I have created the button and in the server tab

$record = $button->getCurrentRecord();

$result["card_ref"]=$record["card_ref"];

$result["song"]=$record["song"];


In the client after tab

location.href='requests_add.php?card_ref='+result["card_ref"]+result["song"];


This produces a url that looks correct but no data gets added to the form

admin 2/26/2015

Doing this is not enough, you also need to set default values of those fields to respective values ($_GET["card_ref"] and $_GET["song"]).
And here is the correct server event code:

location.href='requests_add.php?card_ref='+result["card_ref"]+'&song='result["song"];
G
g_parry author 2/27/2015



Doing this is not enough, you also need to set default values of those fields to respective values ($_GET["card_ref"] and $_GET["song"]).
And here is the correct server event code:

location.href='requests_add.php?card_ref='+result["card_ref"]+'&song='result["song"];



Sorry Sergey - I really am still learning this and your reply just highlights what an idiot I can be - it was the GET I completely forgot about it's now working perfectly
Thanks