Try this:
<asp:TextBox ID="TextBox1" runat="server" onchange="textBox1OnChange(this);"></asp:TextBox>
<!-- Use a TextBox that looks like a Label since otherwise, if the page does a PostBack the values will be lost -->
<asp:TextBox id="TextBox1Label" BorderColor="White" BorderStyle="None" BorderWidth="0" runat="server"></asp:TextBox>
<script type="text/javascript">
<!--
function buttonOnClick(elementRef)
{
var labelId = elementRef.id + 'Label';
// Do the calculations here...
var calculatedValue = elementRef.value;
document.getElementById(labelId).value = calculatedValue;
}
// Need to set the readOnly property here, since setting it in the markup does not persist client-side changes.
function windowOnLoad()
{
document.getElementById('<%= TextBox1Label.ClientID %>').readOnly = true;
}
window.onload = windowOnLoad;
// -->
</script>
NC...