H
Henke
On a web user control I add a html textbox and a html button. To the onclick
event off the button I add a call to myFunc() that resides on my aspx-page
in a script section. In this function I'd like to set the value of the
textbox to some text. I do like this:
function myFunc()
{
textbox.value = "some text";
}
When the code is executed I get a "textbox is null or undefined"
I know a work around and that is if I put my web user control on a form
(myForm) and in the myFunc changes textbox.value to myForm.textbox.value
everything works. But as you understand it's not a good idea to hardcode the
name of the form in the user control.
Any ideas?
/Henke
event off the button I add a call to myFunc() that resides on my aspx-page
in a script section. In this function I'd like to set the value of the
textbox to some text. I do like this:
function myFunc()
{
textbox.value = "some text";
}
When the code is executed I get a "textbox is null or undefined"
I know a work around and that is if I put my web user control on a form
(myForm) and in the myFunc changes textbox.value to myForm.textbox.value
everything works. But as you understand it's not a good idea to hardcode the
name of the form in the user control.
Any ideas?
/Henke