This topic is locked

Server & Client After fails for Field Events... if you have Runner.Dialog

2/14/2023 12:39:40 AM
PHPRunner General questions
M
m3 author

I am trying to use Field Events (on = change)

I have this:

Client Before
return Runner.Dialog (
:
fields: [{name:value}],
:
beforeOK: function (){
params["value"]=controls[0].val();
}
)

(Side note: by right, I shouldn't need beforeOK to pass params. The field name should be sufficient.)

Server
$ SESSION["value"]=params["value"];
$result["txt"]=params["value"];

Client After
alert($result["txt");

The params doesn't get sent to Server. But if I remove the Runner.Dialog, params at the Client Before will send to the Server and Client After.

Anyone with a similar experience?

p.s. - ctrl.dialog works fine on Custom buttons.

W
WilliamBDevClub member 2/16/2023

You almost had it but the javascript is not correct. You can try this.

Client After

alert(result["txt"]);
M
m3 author 2/16/2023

Thanks for the suggestion. That's a typo when posting this.

I used Chrome's Inspect, added breakpoints on the Javascript and set a Watch on result["txt"]. It comes out blank.

I suspect it's because of the Modal nature of Dialog API that is causing it. Hence, I employed a workaround using the old fashion Javascript confirm("Press a button!").