• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

how to get name/value of runtime refrance to from elements

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
i have a form which contains textbox,check box.
there are many records.each record contatins 1 textbox & check box.these are generated at runtime so name also changes at run time.when i click check box onClick i call a function.
in that function how can i get name & value of check box & text box.
so please help me to find name & value of textbox.checkbox.
mahesh
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
give a parameter (i.e. formElement) to your function which will receive a reference to this form element.
and put "this" as parameter when onClick calls a function like this: onClick="functionName(this)"
this is a reference to the current form element.
In the body of your function, you get the name of the element like this:
var nameElement = formElement.name;
 
I claim this furniture in the name of The Ottoman Empire! You can keep this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic