title: Strange behavior using HTML 'readonly="readonly"' vs. JavaScript 'element.readOnly = true;'
body: <h2>Some background</h2>
  
  <p>So I was finishing up some enhancements in a web application that does some automatic interpolation of data.  There are a handful of textboxes that the user fills out, and other textboxes in between them have values automatically calculated.  The textboxes that receive automatically calculated values must be readOnly to prevent user changes, but can't be disabled or they won't get submitted on postback.  Each of these textboxes also has a checkbox next to it so a user can consciously check it to make the field writable and thus allow them to override the interpolated value.</p>
  
  <p>The browser: IE 7 (not sure how this behaves in others)</p>
  
  <h2>The issue</h2>
  
  <p>When setting the <code>readOnly</code> property of the textboxes with JavaScript, the value in the textbox is submitted with the form: I can see it on the server side (ASP.NET) with <code>myTextBox.Text</code> and it's in <code>Request.Form("myTextBox")</code>.</p>
  
  <p>If I set <code>ReadOnly="true"</code> on my <code>&lt;asp:TextBox /&gt;</code> element and don't use the JavaScript method, the value in the text box is <strong>NOT</strong> available from <code>myTextBox.Text</code> (I assume it never made it into the <code>ViewState</code>), but it is getting submitted with the form: <code>Request.Form("myTextBox")</code> has a value.</p>
  
  <h2>My question(s)</h2>
  
  <p>What the heck is going on? Is this by design?  Is this a browser issue? Did I find a bug?  It's annoying that I have to have some extra JavaScript to initially disable the writability of the textboxes when the page loads in order to make my app work.</p>
  
  <p>Thanks!</p>