View Single Post
Old 12-03-2012, 06:53 AM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,555
Thanks: 62
Thanked 4,054 Times in 4,023 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Why did you start another thread asking the *SAME THING*???

In any case, *CLEARLY* you should be doing this in ASP.NET code and *NOT* using JavaScirpt. Period.

And there is NO REASON to use a <div> and then hide the <asp:TextBox> by hiding the <div>.

Instead, when you determine that you want to hide the form field yet still get its value when the <form> is posted, just use
Code:
<asp:HiddenField id="somename" runat="server" value="somevalue" />
instead of
Code:
<asp:TextBox id="somename" runat="server" value="somevalue" />
(And, by the way, you didn't even have the syntax for the textbox correct!! You set its value by assigning to a value= attribute! Not as you were doing it.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote