jquery
$(document).ready(function() {
$('#postcomment').hide();
$('#createtopic').click(function() {
var text = $('#editor1').val();
$.ajax({
type: "post",
url: "Handler/Topic.ashx",
data: "text=" + text,
success: function(msg) {
$("#result").html(msg).fadeIn("fast");
}
});
return false;
});
$('#postcomment').show();
});
html
<textarea id="postcomment" cols="50" rows="3" style="padding:5px;"
name="postcomment" > </textarea>
I am unable to hide the textarea. Is it a wrong approah to hide a textarea?
It’s working fine for me, Fiddle
Things to check:
jQueryscripts.textareawasn’t rendered when the DOM readyhide()action?Update: (After the full code added)
The last option is the winner… You override the
hidewithshowin the last line:Remove it please…