Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

argument in form access

 
Michael McNally
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic