Skip to content Skip to sidebar Skip to footer

Unable To Get Property 'style' Of Undefined Or Null Reference

I have been looking online for a Watermark effect for my textboxes to get some help and found a piece of code which looks like the following : Javascript: function WaterMark(objtxt

Solution 1:

Try this..

    var id=objtxt.id.toString();
    document.getElementById(id).setAttribute("style", "color:Gray");

Solution 2:

Please check if you are getting value of document.getElementById("<%= tb_Password.ClientID %>") or not?

value of document.getElementById("<%= tb_Password.ClientID %>") should not be null.

You can also use .hide() and .show() functions.

Solution 3:

In my case the following worked -

I placed the script just before closing tag of ( as I am using a masterpage) and instead of writing getelementbyid(menuid.UniqueID) I wrote getelementbyid(menuid.ClientID).

Solution 4:

I am also facing this problem and I solve it myself. The issue is related to panel and this panel visible property is false. instead of this set it as display as none value. now its working.

Post a Comment for "Unable To Get Property 'style' Of Undefined Or Null Reference"