This topic is locked
[SOLVED]

 Button disabled

10/12/2010 5:58:35 AM
PHPRunner General questions
Z
Zxenop author

Hi everyone I got a litle problem with the add button function

Basicaly I just want to add a confirmation box before executing any piece of code
so I added this to OnBefore event of my button

return confirm("Are you sure ... blah blah blah");


It's working fine except when I click cancel the button stay disabled, any idea how I can prevent that ?

Z
Zxenop author 10/12/2010

Figured it out,

No matter what you return in OnBefore if there is a return statement the button will be blocked, so if you want to ask for a confirmation before you have to do this



params["confirm"] = "true";

if(!confirm("Are you sure ?"))

params["confirm"] = "false";



A bit of useless function call but nothing too bad I guess