Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > How to access ie a html textbox on a web user control?

Reply
Thread Tools

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

 
 
Henke
Guest
Posts: n/a
 
      11-27-2003
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


 
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
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Rich TextBox / HTML TextBox Jay ASP .Net 5 04-28-2005 11:15 PM
Calendar popup - using ASP textbox instead of HTML textbox =?Utf-8?B?Q2hyaXM=?= ASP .Net 3 03-30-2005 06:02 PM
runat="server"....a simple html textbox or a webform server textbox...that is the question. Hazzard ASP .Net 2 07-23-2003 07:32 AM
Re: runat="server"....a simple html textbox or a webform server textbox...that is the question. Natty Gur ASP .Net 0 07-22-2003 03:57 AM



Advertisments