Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Using JavaScript to Change Server-Side TextBox

Reply
Thread Tools

Using JavaScript to Change Server-Side TextBox

 
 
ftbadolato ftbadolato is offline
Junior Member
Join Date: May 2008
Posts: 1
 
      05-21-2008
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_ContentP laceHolder1_hdnresultbox').value='yes';
}else{
document.getElementById('aspnetForm._ctl0_ContentP laceHolder1_hdnresultbox').value='no';
}

return result;
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide textbox / Make textbox not visible (NOT USING visible property) Jurjen de Groot ASP .Net Web Controls 0 05-19-2008 09:50 AM
using asp:textbox as search box, handling enter in textbox Imran Aziz ASP .Net 2 09-05-2005 11:00 AM
Calendar popup - using ASP textbox instead of HTML textbox =?Utf-8?B?Q2hyaXM=?= ASP .Net 3 03-30-2005 06:02 PM
Using Javascript to change a value in a textbox. Ant Javascript 2 02-19-2005 06:50 PM
How can i change de cssclass of a textbox in runtime using javascript Fernando Lopes ASP .Net 1 11-22-2004 08:29 PM



Advertisments