This topic is locked
[SOLVED]

 multi line alert

5/5/2017 3:18:12 AM
PHPRunner General questions
ffrinai author

Hi,

i'd like to insert an alert in after record added with 2 lines like:
ATTENZIONE:

Importo emesse: 123
i try

echo "<script>alert('ATTENZIONE: \n Importo emesse:". $data["emesse"]."')</script>";

but it doesn't work, with the \n does not appear the popup message
have any idea ?

thanks

Fabio
phprunner 9.7 enterprise build 28565 x64

C
cristi 5/5/2017

You have some problems in your code:

  1. First of all if you put your string message in "" you need to "escape" the special character \n so you write like this: \\n
  2. In after record added event you use $values to access field data and not $data
  3. The syntax for adding the php variable value is not written correctly.
    The correct code would be: echo '<script>alert("ATTENZIONE:\\nImporto emesse: ' .$values['emesse'].'")</script>';