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);
if document.getelementbyid('langselect')
returns null, there must not div id in dom.
Comments
Post a Comment