Problem with javascript
-
hi... In my .aspx file i have a div tag. i am calling javascript function programatically ie. Response.Write("hide();"); at page load event 'coz i want to hide it initially and show the div tag when needed. For hide() i wrote function hide() { document.getElementById('pstage').style.display='none';} i am unable to find my error. it often happens that javascript does not work. pls let me know where is the problem and how to rectify it. SunithaNallana
-
hi... In my .aspx file i have a div tag. i am calling javascript function programatically ie. Response.Write("hide();"); at page load event 'coz i want to hide it initially and show the div tag when needed. For hide() i wrote function hide() { document.getElementById('pstage').style.display='none';} i am unable to find my error. it often happens that javascript does not work. pls let me know where is the problem and how to rectify it. SunithaNallana
If u have this div tag under a form which has attribute runat="server". On page load even you can directly write formName.FindControl("divTagId").visible = false; Make sure again that div tag with id = divTagId has an attribute runat="server" else it will give you an error.
-
If u have this div tag under a form which has attribute runat="server". On page load even you can directly write formName.FindControl("divTagId").visible = false; Make sure again that div tag with id = divTagId has an attribute runat="server" else it will give you an error.
hi..
Prateek G wrote:
If u have this div tag under a form which has attribute runat="server".
u r right but i donot want the div tag to be a server side control,i want it to function as client side control
-
hi..
Prateek G wrote:
If u have this div tag under a form which has attribute runat="server".
u r right but i donot want the div tag to be a server side control,i want it to function as client side control
Create a div with visible attribute as false. And when you want to make it visible use the code. document.getElementById('divTagId').removeAttribute('visible'); since by default visible will be true it will be visible In case again based on any condition if you need to make it invisible use this code document.getElementById('divTagId).visible= "false";