hello again, i want to create a function using javascript, but i dont know how to deal with the arguments….below is my script, as you can see my function keeps repeating, how could i make only one function that would apply to different indexes…
[code=php]
<script >
function makeAble(x) {
document.getElementById(“text[“+x+”]”).disabled=false;
}
function makeDisable(x) {
document.getElementById(“text[“+x+”]”).disabled=true;
}
function makeAble1(y) {
document.getElementById(“text[“+y+”]”).disabled=false;
}
function makeDisable1(y) {
document.getElementById(“text[“+y+”]”).disabled=true;
}
</script>
<body>
<input name=”text1[print $x?>]” type=”text” id=”text1[<? print $x?>]” value=”” onClick=”makeDisable(<? print $x?>)” onDblClick=”makeAble(<? print $x?>)” >
<input name=”text2[print $y?>]” type=”text” id=”text2[<? print $y?>]” value=”” onClick=”makeDisable1(<? print $y?>)” onDblClick=”makeAble1(<? print $y?>)” >
</body.