This topic is locked

Updating multiple selected records based on a combobox

1/30/2012 12:40:35 PM
PHPRunner General questions
S
smith author

Hi,
Any updates for this topic for PHPRunner v6.0
check below link which was implemented on v5.x series but how to do this in v6.o
http://www.asprunner.com/forums/topic/14188-updating-multiple-selected-records-based-on-a-combobox-value-on-list-page/

Regards

Smith

C
cgphp 1/30/2012

Insert a button on the list page near the combobox. In the "Client before" tab get the combo value and in the "Server" section update the selected records.

S
smith author 1/31/2012

In my server tab of Button near combobox



global $dal;

for ($i=0; $i<count($keys); $i++)

{

// set ReportsTo field to 'Bob Smith'
$sql = "Update enq_enquiry set status=" . @$_POST["a"] . " where id="
. $keys[$i]["id"];
CustomQuery($sql);

}

$result["txt"] = "Records were updated.";


and in My "Client before" tab

var text = document.getElementById("dropdown1").options[document.getElementById("dropdown1").selectedIndex].value;

// Put your code here.

params["txt"] = "Hello";

ctrl.setMessage("Sending request to server...");

// Uncomment the following line to prevent execution of "Server" and "Client After" events.

// return;


WHEN I SELECT SOME LIST AND PRESS BUTTON IT SHOWS ONLY "Sending request to server" no updations, i feel the code above is having some problem????
Smith



Insert a button on the list page near the combobox. In the "Client before" tab get the combo value and in the "Server" section update the selected records.

C
cgphp 1/31/2012

Do you get errors in the server response (check firebug)? What is @$_POST["a"]?

S
smith author 2/1/2012

I'm getting error

throw new SyntaxError('JSON.parse');




Do you get errors in the server response (check firebug)? What is @$_POST["a"]?

S
smith author 2/1/2012

Now in the updated manual the scipt is

global $dal;
for ($i=0; $i<count($keys); $i++)
{
// set ReportsTo field to 'Bob Smith'
$sql = "Update employees set ReportsTo='Bob Smith' where KeyField="
. $keys[$i]["KeyField"];
CustomQuery($sql);
}

$result["txt"] = "Records were updated.";


What will be the script to get variable selected in dropdown to place as the value insted of "Bob Smith" in the above script,?? there is no question of " . @$_POST["a"] . " in this script, what is the alternative method to make this value to pass on to the above script.

S
smith author 2/2/2012

Is it possible with PHPR v6??? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=64089&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />



Now in the updated manual the scipt is

global $dal;
for ($i=0; $i<count($keys); $i++)
{
// set ReportsTo field to 'Bob Smith'
$sql = "Update employees set ReportsTo='Bob Smith' where KeyField="
. $keys[$i]["KeyField"];
CustomQuery($sql);
}
$result["txt"] = "Records were updated.";


What will be the script to get variable selected in dropdown to place as the value insted of "Bob Smith" in the above script,?? there is no question of " . @$_POST["a"] . " in this script, what is the alternative method to make this value to pass on to the above script.