Win a copy of The Career Toolkit this week in the Jobs Discussion forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

argument in form access

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a form(controlForm) with a table inside. some of the table elements have names. I have created a function that will toggle the display of all elements with that name. here it is:

Why doesn't this argument work in object access? I have also tried this function and still it doesn't work. All help is welcomed. thanks
 
Marshal
Posts: 67496
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
document.getElementsByName returns a collection, not a singleton element.
hth,
bear
 
Michael McNally
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i see. so in order to use the document.getElementsByName with a single argument, that single argument would need to be an array element such as name[0].
Either way, after 2 hours of rethinking this equation, it all seems to be very simple...

This script effectively toggles the display of up to four objects(in this case: table rows) when invoked with the onclick handler of the top row that controls them. like this:

Great way to make a control panel or menu.
[ July 12, 2003: Message edited by: Michael McNally ]
 
Michael McNally
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just made an even larger improvement
 
Michael McNally
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perfect Form! Toggles the display of all listed arguments without any flaws.
 
Honk if you love justice! And honk twice for tiny ads!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic