I have a checkbox that when checked I'd like to show a hidden textarea... I've been trying a number of different things and it either doesn't work at all or if I select one it shows all the text boxes on the page INSTEAD of the specific one that was selected.
Can someone explain to me in detail how this process works? I have some working code that I've done pretty much the same thing. Click a div and show a table...click it again and it hides... I look at these two bits of code and I have no idea why one works and the other doesn't... I'm just trying to figure this out and learn a little at the same time. Help is appreciated!!
this is my non-working code.... .check_msg is the checkbox, .msg is the textarea
when checked or unchecked it applies it to all the textareas... I just want the one selected to show the according textarea...
here's my other working code... (i tried to copy this same code and change the classes and it will not work)
Can someone explain to me in detail how this process works? I have some working code that I've done pretty much the same thing. Click a div and show a table...click it again and it hides... I look at these two bits of code and I have no idea why one works and the other doesn't... I'm just trying to figure this out and learn a little at the same time. Help is appreciated!!
this is my non-working code.... .check_msg is the checkbox, .msg is the textarea
Code:
$('.check_msg').click(function(){ if (this.checked) { $(".msg").show("slow"); } else{ $(".msg").hide("slow"); } })
here's my other working code... (i tried to copy this same code and change the classes and it will not work)
Code:
$(".show_story").click(function () { $(this).next(".outer_table").slideToggle("slow"); }); $(".show_story1").click(function () { $(this).next(".outer_table1").slideToggle("slow"); });
Comment