HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
GetButtonCtrl when no ID, name, or value if specified in the
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Form
View previous topic :: View next topic  
Author Message
Patrick



Joined: 20 Dec 2004
Posts: 1

PostPosted: Mon Dec 20, 2004 3:25 pm     GetButtonCtrl when no ID, name, or value if specified in the Reply with quote

How do you get the name, ID, or value of a button in an HTML page when none is specified? I am trying to GetButtonCtrl (VBScript function) but cannot get the ID, name, of value of the button on the web page?

Please help me understand this better.
Patrick
kanenas



Joined: 14 Dec 2004
Posts: 191

PostPosted: Fri Jan 07, 2005 7:30 am     Need clarification. Reply with quote

When you say a button has no name, ID, or value, do you mean defined like one of:
Code:
<input type='button'></input>
<button />


If so, there are a few ways I can think of. Iterate over:

  • document.getElementsByTagName('input') or document.getElementsByTagName('button')
  • document.forms[f].childNodes, where 'f' is the id or index of the form containing the button (if such exists), until you find the button you seek.
  • btnParent.childNodes, where btnParent is the node containing the button (gotten by document.getElementById(btnParentId), or by recursively finding the parent of btnParent or some other method)


I assume you're not working a page you have write access to and cannot add an id to the button.

Are you sure GetButtonCtrl is a part of the VBScript API and not VB?
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Form All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial