I am using Jquery to hide a textbox and show it when the user clicks a button
Hide:
$('#TextBox1').hide();
Show:
$('#TextBox1').show();
Everything works fine. But on google chrome, the textbox is losing its value. if the user type a text then hide it and show it again the textbox is empty.
This is happening only on google chrome. On firefox and explorer it works fine
Any idea about it?
Thanks
EDIT: There is something i forgot to mention is that i am hiding the DIV that contains the textbox and not the textbox itself here is the Jcode
$("#EditName").click(function (event) {
event.preventDefault();
$("#TextBoxDIV").show();
}
$("#HideName").click(function (event) {
event.preventDefault();
$("#TextBoxDIV").hide();
}
and the textbox
<div id = "TextBox1" class="TextFieldEditSmaller">
@Html.TextBoxFor(m => m.Name) //This is an MVC3 application
</div>
EDIT2: I just noticed that the text is there but it is hidden behind something. if I CTRL + A inside the textbox and then I copy/Paste in notepad it shows