Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > how to access an object in a form with getElementById?

Reply
Thread Tools

how to access an object in a form with getElementById?

 
 
Carl
Guest
Posts: n/a
 
      09-05-2003
Assume a form with a button

<form id="myform"
<input id="mybutton" type="button">
</form>

how can i use getElementById to access the button?
I tried this:
var a
a=document.getElementById("mybutton")

but i get an error "a is not an object"
Any idea?
Carl


 
Reply With Quote
 
 
 
 
Vjekoslav Begovic
Guest
Posts: n/a
 
      09-05-2003
"Carl" <> wrote in message news:bja426$9t1$...
> Assume a form with a button
>
> <form id="myform"


Missing ">".

> <input id="mybutton" type="button">
> </form>
>
> how can i use getElementById to access the button?
> I tried this:
> var a
> a=document.getElementById("mybutton")
>
> but i get an error "a is not an object"
> Any idea?
> Carl
>
>



 
Reply With Quote
 
 
 
 
Carl
Guest
Posts: n/a
 
      09-05-2003
yes, it's stupid, thanks



 
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
How to retrieve form field value if form is EncType=multipart/form-dataForm? Li Zhang ASP .Net 4 02-27-2009 01:23 AM
<form>...</form> - how to supress blank space after </form> in IE? rob c Javascript 4 12-30-2005 01:18 PM
Object creation - Do we really need to create a parent for a derieved object - can't the base object just point to an already created base object jon wayne C++ 9 09-22-2005 02:06 AM
Document Object Model - table instead of form?? - slow processing in large form! Edward Javascript 1 01-04-2004 03:25 AM



Advertisments