Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting a form name from the select

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two selects in a form called Form1, respectively called firstSelect and secondSelect.
The firstSelect has an onchange event defined like this:
<select name="firstSelect" onchange="changVal(this, document.myform.secondSelect)">

When the value changes, changVal(oElem,oTarget) is called.
In changVal(), calling alert(oTarget.form.name) will display the form name Form1.

Can you please explain this ? I can't see anything about Select components having a property called form in the HTML Specification. Maybe I'm looking at the wrong spec.

(For those who own Ajax In Action, please refer to Listing 9.2, page 333)
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Had a look at the MSDN reference, select does have a attribute named form:

select in HTML

Specifically,
form attribute on HTML Object
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
Referring to the link you've posted, I've figured out that it was part of Document Object Model HTML.
http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-94282980
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic