extremed
11-23-2010, 11:14 AM
Hi
This is my code to show/hide textarea when checkbox click
how can i add jquery slide to textarea when it show and hide?
1 <input type = "checkbox" id = "chk1" onclick = "toggle(1)">
2 <input type = "checkbox" id = "chk2" onclick = "toggle(2)">
3 <input type = "checkbox" id = "chk3" onclick = "toggle(3)">
4 <input type = "checkbox" id = "chk4" onclick = "toggle(4)">
5 <input type = "checkbox" id = "chk5" onclick = "toggle(5)">
<textarea id = "t1" rows = "4" cols = "50" style="display:none">1</textarea>
<textarea id = "t2" rows = "4" cols = "50" style="display:none">2</textarea>
<textarea id = "t3" rows = "4" cols = "50" style="display:none">3</textarea>
<textarea id = "t4" rows = "4" cols = "50" style="display:none">4</textarea>
<textarea id = "t5" rows = "4" cols = "50" style="display:none">5</textarea>
<script type = "text/javascript">
function toggle(which){
var ta = "t" + which;
var box = "chk" + which
if (document.getElementById(box).checked ) {
document.getElementById(ta).style.display="block";
}
else {
document.getElementById(ta).style.display="none";
}
}
</script>
Sorry for language errors
Thanks
This is my code to show/hide textarea when checkbox click
how can i add jquery slide to textarea when it show and hide?
1 <input type = "checkbox" id = "chk1" onclick = "toggle(1)">
2 <input type = "checkbox" id = "chk2" onclick = "toggle(2)">
3 <input type = "checkbox" id = "chk3" onclick = "toggle(3)">
4 <input type = "checkbox" id = "chk4" onclick = "toggle(4)">
5 <input type = "checkbox" id = "chk5" onclick = "toggle(5)">
<textarea id = "t1" rows = "4" cols = "50" style="display:none">1</textarea>
<textarea id = "t2" rows = "4" cols = "50" style="display:none">2</textarea>
<textarea id = "t3" rows = "4" cols = "50" style="display:none">3</textarea>
<textarea id = "t4" rows = "4" cols = "50" style="display:none">4</textarea>
<textarea id = "t5" rows = "4" cols = "50" style="display:none">5</textarea>
<script type = "text/javascript">
function toggle(which){
var ta = "t" + which;
var box = "chk" + which
if (document.getElementById(box).checked ) {
document.getElementById(ta).style.display="block";
}
else {
document.getElementById(ta).style.display="none";
}
}
</script>
Sorry for language errors
Thanks