document.getElementById problem in JS

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
helloise
Forum Commoner
Posts: 31
Joined: Tue Sep 21, 2010 4:20 am

document.getElementById problem in JS

Post 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
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: document.getElementById problem in JS

Post by Darhazer »

please show the html code for lpm_service_catcher_id element
Is it the only one with this ID?
Post Reply