Hi,
I'm not good at all at JavaScript but I'm trying, so bear with me.
What I want to do is that when I click on a <input type="text" /> tag the checkbox next to it should become checked. I've tried with the help of internet for a couple of hours but I just can't find how I interact with other objects properly to achieve what I want to accomplish.
I've tried with this code:
<table>
<tr>
<td><input type="text" onclick="boxTicker(this.form, 'change_user')"/></td><td><input id="change_user" type="checkbox" name="change_user"/></td>
</tr>
</table>
and the javascript...
function boxTicker(formName, boxId){
var box = eval("document.checkboxform.getElementById(boxId)");
if (box.checked == false){
box.checked = true;
alert("Ticked!");
}
}
But I honestly don't have a clue of what I'm doing. I would be very grateful for any help suggested!