This topic is locked
[SOLVED]

 PHPrunner Create Button to update a value.

12/16/2011 6:23:37 PM
PHPRunner General questions
S
stec5345 author

While on an edit page, I want to enter text into one field and click a button to have it update a status in the same table but a different field. In a sense, what I am trying to accomplish is a button that if the person reading the data on the edit page is happy with the entered text, he or she can click a button called "Accept" which will in turn update the status field to "Signed" and return the user back to the list page.
Any help for this? I am currently using PHPrunner 6 and the table name is a view named dictationqueue.
Thanks

Steve

7542 12/17/2011

Why create a button, is it not easier for the user to click the submit button (renamed to what you want) then run an update event based before add keyfield = $keys["keyfiled"]. If that's not easier just run the update event on the server side of the button (add new button on the visual editor tab).

S
stec5345 author 12/18/2011

That is good advice but may not work as the final desired affect. I will give it a shot but would still like to know how to do this with a button so that I can have more options that just submit from the edit view. There may be a submit which does what you say but I may want to bypass the submit and allow for 2-3 options for the user to do.
Steve

C
cgphp 12/18/2011

Why not add the "Accept" button beside each record on the list page? The status field will be updated with an ajax call.

L
laonian 12/20/2011

[size="3"]
[size="3"][color="#0000FF"]2. Then add the following in the Before record updated event of your Edit page:[/size]
$values["status"]='Signed';
[size="3"]3. Add the redirect link in the After record updated event of your Edit page:[/size]
header("Location: dictationqueue_list.php?a=return");

exit();

S
stec5345 author 1/15/2012



[size="3"]
[size="3"][color="#0000FF"]2. Then add the following in the Before record updated event of your Edit page:[/size]
$values["status"]='Signed';
[size="3"]3. Add the redirect link in the After record updated event of your Edit page:[/size]
header("Location: dictationqueue_list.php?a=return");

exit();


I will giove this a shot. Thanks