• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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;
 
reply
    Bookmark Topic Watch Topic
  • New Topic