- Joined
- May 21, 2008
- Messages
- 1
- Reaction score
- 0
I have the following TextBox on my .aspx page.
<asp:TextBox ID="hdnresultbox" Style="z-index: 101; left: 520px; position: absolute;
top: 632px" runat="server" Width="1px" Height="1px" ReadOnly="false">no</asp:TextBox>
The JavaScript from viewing the source is as follows. There is some JS above what you see here, but it is working fine. I also have a try...catch around all of this. The error that occurs is [object Error] and it occurs on the lines below when I attempt to set the value of the text box. The text box is on the page, but I am thinking it may have something to do with the runat="server" in the code above. I need that though b/c I check the field in my code-behind file as well. I need help on updating the value of this field via JavaScript.
if(result == true){
document.getElementById('aspnetForm._ctl0_ContentPlaceHolder1_hdnresultbox').value='yes';
}else{
document.getElementById('aspnetForm._ctl0_ContentPlaceHolder1_hdnresultbox').value='no';
}
return result;
<asp:TextBox ID="hdnresultbox" Style="z-index: 101; left: 520px; position: absolute;
top: 632px" runat="server" Width="1px" Height="1px" ReadOnly="false">no</asp:TextBox>
The JavaScript from viewing the source is as follows. There is some JS above what you see here, but it is working fine. I also have a try...catch around all of this. The error that occurs is [object Error] and it occurs on the lines below when I attempt to set the value of the text box. The text box is on the page, but I am thinking it may have something to do with the runat="server" in the code above. I need that though b/c I check the field in my code-behind file as well. I need help on updating the value of this field via JavaScript.
if(result == true){
document.getElementById('aspnetForm._ctl0_ContentPlaceHolder1_hdnresultbox').value='yes';
}else{
document.getElementById('aspnetForm._ctl0_ContentPlaceHolder1_hdnresultbox').value='no';
}
return result;