Page 1 of 1

document.getElementById problem in JS

Posted: Tue Feb 15, 2011 6:41 am
by helloise
i have the code in JS:

Code: Select all

 if(drop_list.value == "zed-catcher/11")
            {
               input_box.disabled=false;
               var catcher_id = document.getElementById('lpm_service_catcher_id');
               catcher_id.value = 11;
            }
            else
               input_box.disabled=true;
how come the line catcher_id.value = 11; is not setting the value to 11????
i get that catcher_id = null????

pleas help
thanks

Re: document.getElementById problem in JS

Posted: Tue Feb 15, 2011 10:09 am
by Darhazer
please show the html code for lpm_service_catcher_id element
Is it the only one with this ID?