Making non editable controls editable on click of link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramyasarangapani
    New Member
    • Mar 2008
    • 1

    Making non editable controls editable on click of link

    Hi,

    i have a issue in html.in a table,initially all the controls should be disabled.on click of edit link in each row,the respective row controls should be editable.
    i have not used forms.pls help asap
  • pronerd
    Recognized Expert Contributor
    • Nov 2006
    • 392

    #2
    You should be able to find lots of examples of this by googling.

    Basically to change the input fields status you want to do something like what is shown below. You will need to google for the exact CSS syntax for the style attribute to control read-only status. I do not remember exactly what it is off the top of my head.


    Code:
    <span onclick="changeReadOnly('someButton')" >edit</span>
    
    <input type="radio" id="someButton" />
    
    <script>
        function changeReadOnly( elementId ) {
            var inputElement = document.getElementById( elementId );
            inputElement.style.readOnly = 'false';
        }
    </script>

    Comment

    Working...