javascripts+set attributes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anudu
    New Member
    • Oct 2007
    • 31

    javascripts+set attributes

    Hi,

    i am developing a system using asp.net(c#) and javascripts. i make a button in my form disabel in page load method. if a radio button in my page is clicked i have to enable that button. i am using a javascript method in client side to enable the button. however i am calling another javascript method on "onclientcl ick" method of the button. i have discovered that this onclientclick method is not called after i enabled the button by clicking the radio button.

    i tried to use setAttributes method in javascript method of enabling the button back.
    document.getEle mentById("btnSa ve").setAttribu te("onclientcli ck","javascript :retrun validateMthod() ;");

    but it does not work

    please help
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Post the code you used. Most likely you are mixing client side code with server side code.

    Comment

    • RamananKalirajan
      Contributor
      • Mar 2008
      • 608

      #3
      Dont complex your logic. The basic concept behind hiding and displaying an element in javascript is very simple. Suppose i am having a button with
      id --> 'myButton'. Then use the code in the following way

      [HTML] document.getEle mentById('myBut ton').style.dis play= 'none' (to Hide)[/HTML]
      &&

      [HTML]document.getEle mentById('myBut ton').style.dis play= 'block' (to Unhide It)[/HTML]
      If you have any doubts pls post back it. surely I can help you.

      Regards
      Ramanan Kalirajan

      Comment

      Working...