This topic is locked
[SOLVED]

 Jump to Edit from List Button

9/11/2018 3:25:26 PM
PHPRunner General questions
P
PhpApprentice author

I have a button in a list http://localhost/dlrpage_list.php
When pushed it creates a record in a different table via CustomSQL insert, and captures the key field value of that new record.
So I want to jump from the list over to the new record in the new table in Edit mode as the user has some additional data to add.

Something like

http://localhost/transactions_batch_edit.php?editid1=1103647
I have attempted various code and either nothing happens or I get a server error, without any error data.
Please what is the proper way to code this?

admin 9/12/2018

There must be an error message behind the scene. Check this:

https://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm

P
PhpApprentice author 9/17/2018



There must be an error message behind the scene. Check this:

https://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm


I am attempting a straightforward
$result["txt"] = "Records added";
header("Location: transactions_batch_list.php");

exit();
at the end of OnServer function
the response does show
transactions_batch_list.php

default.css

general.css

style.css

list_centeredhor.css

jquery-ui.min.css

jquery-ui.theme.min.css

loadfirst.js?
=1537214709946

English.js?=1537214709947

RunnerAll.js?
=1537214709948

yui-min.js

ajaxsuggest.js
Then stops.

I turned off Norton.
I told ajax in appsettings.php

$useAJAX = false;

$suggestAllContent = false;
Still failing without a detailed error message

A link to see details, but no details are displayed

admin 9/17/2018

You cannot do server side redirect in button's code. Buttons are executed via AJAX and your redirect will be lost.
https://xlinesoft.com/phprunner/docs/inserting_button.htm

See examples #4 or #6.

P
PhpApprentice author 9/19/2018

Works Excellent
Server
At the End of OnServer Function
$result["txt"] = $str_newid ;
Client After
OnClient Function
var message = "transactions_batch_edit.php?editid1=" + result["txt"];
location.href=message;