How to get element from php array in jquery
HI,
I have a js script that checks the datas inserted in a form.
I have a PHP array containing some error message :
This array is available for different languages : en, it, fr. When a user fills a field with a wrong value, I should be able to send
en_lang :
<?php
$myArray = array(
'wrong_password' => 'Wrong password'
'wrong_phone_number ' => 'This is not a phone number'
}
it_lang :
<?php
$myArray = array(
'wrong_password' => 'Password sbagliata'
'wrong_phone_number ' => 'Numero di cellulare non valido'
}
From the javascript file I would send in output the error text for the specific loaded language that should be visible in a div.
<label class="error">'+ $('#myArray '['wrong_password']).val()+'</label>
It seems the array is not recognized from the js script.
How can I get the array value for the error?
Thanks in advance
AMR13