I have created UserControl that I wish to use on multiple pages. This control contains classic javascript but for some reason it will not load element to a variable. Client IDs look ok. 

This is button that activates javascript:

```
<input type="submit" name="ctl00$ContentPlaceHolder1$ContactList$btn_NewContact" value="Potvrdit" onclick="javascript:return CheckContactName();" id="ContentPlaceHolder1_ContactList_btn_NewContact" class="MyButton" style="color:white;" />

```

This is the textbox:

```
<input name="ctl00$ContentPlaceHolder1$ContactList$con_fullname" type="text" id="ContentPlaceHolder1_ContactList_con_fullname" class="MyTextBox" />

```

This is Javascript function:

```
    function CheckContactName() {
    name = document.getElementById("ContentPlaceHolder1_ContactList_con_fullname");

    if (name.value == '' | name.value == null) {
        return false;
    }

    UploadContact();

    return true;
}

```

Now, when I debug this in a console the **name.value** is undefined. The **name** variable itself is just **"[object HTMLInputElement]"**.

So no matter what is in that textbox, this function is always false. I also checked all IDs inside final client page and there are no duplicates. Can you tell why this is? Thanks.