Reputation: 2393
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
?
Upvotes: 0
Views: 12054
Reputation: 150313
It's working fine for me, Fiddle
Things to check:
jQuery
scripts.textarea
wasn't rendered when the DOM readyhide()
action?Update: (After the full code added)
The last option is the winner... You override the hide
with show
in the last line:
$('#postcomment').show();
Remove it please...
Upvotes: 5