php - Problems with javascript function onchange -


hello stackoverflow people, i've been coding sometime , got stuck script. because cant find out why im getting console error:

typeerror: document.getelementbyid(...) null   var nlang = document.getelementbyid('langselect').value; 

ive tried doing function onchange , ve tried this:

document.getelementbyid('langselect').onchange = function() { 

but didnt worked too. wrong script, here javascript code:

function waschanged(){     var nlang = document.getelementbyid('langselect').value;     var currentuser = <?php echo json_encode($appui->user_id); ?>; }; 

and here php code:

    echo arrayselect($langlist, 'pref_name[locale]', 'onchange="waschanged()" class="text" size="1"', $userlang, true); 

enter image description here

if document.getelementbyid('langselect') returns null, there must not div id in dom.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -