How to access ie a html textbox on a web user control?

Discussion in 'ASP .Net Building Controls' started by Henke, Nov 27, 2003.

  1. Henke

    Henke Guest

    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
    Henke, Nov 27, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S. Justin Gengo
    Replies:
    0
    Views:
    518
    S. Justin Gengo
    Jul 16, 2003
  2. Matthew Louden
    Replies:
    1
    Views:
    6,913
    Scott M.
    Oct 11, 2003
  3. ABC
    Replies:
    1
    Views:
    2,634
    Larry
    Oct 4, 2005
  4. ABC
    Replies:
    0
    Views:
    477
  5. ABC
    Replies:
    0
    Views:
    196
Loading...

Share This Page