Hello stackoverflow people, i've been coding for sometime and got stuck with this script. Because i cant find out why im getting console error:
TypeError: document.getElementById(...) is null var Nlang = document.getElementById('langSelect').value;
ive tried doing as function onchange and ve tried this:
document.getElementById('langSelect').onchange = function() {
But that didnt worked too. What is wrong with this script, here is my javascript code:
function WasChanged(){
var Nlang = document.getElementById('langSelect').value;
var currentUser = <?php echo json_encode($AppUI->user_id); ?>;
};
And here is my php code:
echo arraySelect($langlist, 'pref_name[LOCALE]', 'onchange="WasChanged()" class="text" size="1"', $userLang, true);

echo arraySelect($langlist, 'pref_name[LOCALE]', 'onchange="WasChanged()" class="text" size="1"', $userLang, true);This is the code witch creates the html with selectlangSelectin your html?