• 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

help me with this problem..

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



onclick of button I want the textbox value associated with that button.
if button[0] is clicked I want the hid_text[0].value
if button[1] is clicked I want the hid_text[1].value

how to get the corresponding value?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whenever you have a form element with a name that includes JavaScript-sensitive characters such as periods and square brackets, you can't use the usual JavaScript notation of "document.myForm.myInput". However, with JavaScript there's always more than one way to do things, so you just have to get a little creative about how to access the object. One way would be to use the getElementsByName method. This method always returns an array, even if there's only one element with that name. Therefore, something like the following would work:

[ March 23, 2007: Message edited by: Merrill Higginson ]
 
I've read about this kind of thing at the checkout counter. That's where I met this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic