I have the following code and what I want it to do is that by giving the image the id
of that tr
in concrete and all textBox become enable
...
I've tried it with document.getElementById("name").disabled = false;
... but it just makes me the first row and when I pick up the id
of the row I do not know how to write it.
function modify(id){
var cell = id.parentNode;
var row = cell.parentNode;
row=row.rowIndex;
document.getElementById("name").disabled = false;
document.getElementById("apellidos").disabled = false;
document.getElementById("telef").disabled = false;
document.getElementById("email").disabled = false;
document.getElementById("cargo").disabled = false;
}
<table name="table1" id="table1">
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
<th>5</th>
<th>6</th>
<th>7</th>
</tr>
<tr>
<th><input id='name' name='name' size='8' value='1' disabled></input></th>
<th><input id='apellidos' name='apellidos' size='10' value='1' disabled></input></th>
<th><input id='telef' name='telef' size='8' value='1' disabled></input></th>
<th><input id='email' name='email' size='12' value='1' disabled></input></th>
<th><input id='cargo' name='cargo' size='8' value='1' disabled></input></th>
<th><input type="checkbox" name="email" value="1"></th>
<th >
<img onclick=modify(this); src="--.jpg">
<img onclick=opc(this); src="--.jpg">
<img onclick=delete(this); src="--.jpg">
</th>
</tr>
<tr>
<th><input id='name' name='name' size='8' value='1' disabled></input></th>
<th><input id='apellidos' name='apellidos' size='10' value='1' disabled></input></th>
<th><input id='telef' name='telef' size='8' value='1' disabled></input></th>
<th><input id='email' name='email' size='12' value='1' disabled></input></th>
<th><input id='cargo' name='cargo' size='8' value='1' disabled></input></th>
<th><input type="checkbox" name="email" value="1"></th>
<th >
<img onclick=modify(this); src="--.jpg">
<img onclick=opc(this); src="--.jpg">
<img onclick=delete(this); src="--.jpg">
</th>
</tr>
<tr>
<th><input id='name' name='name' size='8' value='1' disabled></input></th>
<th><input id='apellidos' name='apellidos' size='10' value='1' disabled></input></th>
<th><input id='telef' name='telef' size='8' value='1' disabled></input></th>
<th><input id='email' name='email' size='12' value='1' disabled></input></th>
<th><input id='cargo' name='cargo' size='8' value='1' disabled></input></th>
<th><input type="checkbox" name="email" value="1"></th>
<th >
<img onclick=modify(this); src="--.jpg">
<img onclick=opc(this); src="--.jpg">
<img onclick=delete(this); src="--.jpg">
</th>
</tr>
</table>