This topic is locked
[SOLVED]

 Popup message boxes

2/24/2017 10:21:27 AM
PHPRunner General questions
M
miles authorDevClub member

i have a form which allows me to create a new client record and saves fine, when the record saves i have added some php in the 'after record added' event as follows
echo "Reference number allocated is: ".$values['Reference'];
this works fine but just doesn't look the part as the text just shows at the top of the page and is a bit unsightly, i would like this as a popup box so that the person saving the record actually sees the reference number allocated once the record is saved.
i tried adding a script popup but cannot seem to get it to show a variable...
echo "<script>alert('I\'m a popup window')</script>"; (this works fine)
i changed to echo "<script>alert('New record added: "+$values['Reference']+"')</script>"; but it doesn't work
Is there any way i can make this happen?

M
miles authorDevClub member 2/24/2017

answered my own question...
this is how I did it:
echo "<script>alert('New Reference number is: ".$values['Reference']."')</script>";

I tried using + instead of . oops!