Hello,
I need to access a asp.net textbox using javascript inside a user control. I am using javascript to display/collapse sublinks underneath a main link when the user clicks on the main link. I can easily display the sublinks but I need to keep state information inside a textbox (when user expands link I will put a value inside the textbox). Normally, I do something like this to find value inside a textbox:
<code>
document.Form1.txtFirstPage.value
</code>
However, with a .net user control there is no form. I think that I should be able to use something like this:
<code>
document.getElementById(“txtSomeTextBox”).style.value;
</code>
However, this does not work because this syntax is wrong. The main question I have is:
how do I access a textbox value inside a .net user control using JavaScript? Especially using the getElementById function if this is possible.
Also, if anyone has simple code on how to do what I’m doing (expand/collapse sublinks underneath a main link using JavaScript) I’d be thrilled to see it.
Thanks much,
Joe