Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
865
Setting the visibile property in javascript
posted

Hi,

   i want to edit the password for a particular user. i have created a page for it where i have 3 webimage buttons namely, cmdEdit,cmdSave,cmdCancel. when the a user click on the cmdEdit button, the cmdSave and cmdCancel should be visible. i want to do it in the javascript. i already have written the code for it.. please find the script below

function cmdEdit_Click(oButton, oEvent)
{
    
var savebutton = ig_getWebControlById("cmdSave");

var cancelbutton= ig_getWebControlById("cmdCancel");
  
oButton.setVisible(false);       

savebutton.setVisible(true); 
      cancelbutton.setVisible(true);
   
       
   
}

i have disabled the cmdSave and cmdCancel inthe page_load event in the server-side.the problem i face is that the cmdEdit button gets invisible and the rest is not working. can someone tell me what could be the problem?

 

thanks

jollyguy77

 

 

Parents
No Data
Reply
  • 21382
    posted

    Is your browser giving you a "null reference not found" javascript exception?  

     Your code is setting the

    jollyguy77 said:


    var savebutton = ig_getWebControlById("cmdSave");

     [snip]

    savebutton.setVisible(true); 

     


     

    If you set the Visible to false on the server, then ASP.Net isn't going to send down the html for the control.  Same happens with a default control if I am not mistaken.  

     

    You would need to send the control down with Visible = true and set Visible = false on the client. 

Children
No Data