I have three textbox
<asp:TextBox ID="TextBox1" runat="server" Text="0" ></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" Text="0" ></asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server" Text="0" ></asp:TextBox>
And one javascript function
<script type="text/javascript">
function calc()
{
var _txt1 = document.getElementById('<%= TextBox1.ClientID %>');
var _txt2 = document.getElementById('<%= TextBox2.ClientID %>');
var _txt3 = document.getElementById('<%= TextBox3.ClientID %>');
var t1=0, t2=0;
if(_txt1.value != "") t1=_txt1.value;
if(_txt2.value != "") t2=_txt2.value;
_txt3.value = parseFloat(t1) + parseFloat(t2);
document.BuyForm.TextBox3.value = _txt3.value;
}
</script>
But i have difficulty to assigning textbox value like "document.BuyForm.TextBox3.value = _txt3.value;"
how can i use server control in document.form.element.value in element?