• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

argument in form access

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just made an even larger improvement
 
Michael McNally
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perfect Form! Toggles the display of all listed arguments without any flaws.
 
reply
    Bookmark Topic Watch Topic
  • New Topic