This topic is locked

Cannot get Alert to work

4/28/2009 1:48:45 PM
PHPRunner General questions
J
jalongi author

This has been driving me crazy since updating to 5.1. A simple java alert will not execute nor will an echo.
<script language=javascript>

alert("This is a test");

</script>
I've tried it all different ways and still cannot get it to run.
Any help would be greatly appreciated.
Joe

Sergey Kornilov admin 4/28/2009

Where do you put this code?

J
jalongi author 4/28/2009

In the before record updated event. It is checking to see if a record exists but has been stripped down to just this code just to get it working. The application is running on a 2008 server and everything else seems to work properly. If I create a stand alone php script with the code, it works fine. Put it in the event, and it gets ignored. Is there any other way to create a pop up window besides alert?
Thanks

Joe

Sergey Kornilov admin 4/28/2009

Events expect PHP code which means Javascript won't work there.
Try the following:
echo '<script language=javascript>alert("This is a test");</script>';

J
jalongi author 4/29/2009

Already tried that. Still does not work. Could it have anything to do with the php.ini file missing?

Sergey Kornilov admin 4/29/2009

Have no idea how php.ini is related to this issue.
I recommend to post your application to Demo Account (use 'Demo Account' button on the last screen in program). Then open a ticket at http://support.xlinesoft.com sending your Demo Account URL for investigation.

cyberjas2001 4/30/2009

Try this, it worked for me:
echo "<script>alert('Your message')</script>";

J
jalongi author 5/1/2009

Thanks, but I already tried switching the quotes. The strange thing is if I open it in 5.0 and build, it works. Open in 5.1 and build, the java script will not execute. The events are working, but the script doesn't. I've also tried it in other events and it still will not execute. This is very frustrating.
Joe

J
jalongi author 5/1/2009

This is a followup. I created a new project from scratch using 5.0. One table, one event with the "alert" code. Everything works. Do the exact same thing with 5.1, it will not work!!!! I've uninstalled/reinstalled 5.1, but still the same problem. Also, whenever I change a table (i.e. add a field), 5.1 will not pick up the change. I have to open in 5.0, save and then it shows up in 5.1. Any help or suggestions.......

Sergey Kornilov admin 5/1/2009

Post your application to Demo Account (use 'Demo Account' button on the last screen in program). Then open a ticket at http://support.xlinesoft.com sending your Demo Account URL for investigation.

J
jalongi author 5/1/2009

Sergev,
I've uploaded to the demo account and submitted a ticket.
Thank you for you help.
Sincerely,
Joe Alongi

J
Jane 5/4/2009

Joe,
use following code in PHPRunner 5.1:

ob_end_flush();

echo "<script>alert('Your message')</script>";

J
jalongi author 5/5/2009

Thanks Jane. Problem solved......