Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Reference a column name in xsl from within JavaScript >Thread Next - Re: Reference a column name in xsl from within JavaScript Re: Reference a column name in xsl from within JavaScriptTo: NULL Date: 6/15/2007 1:46:00 PM Doogie wrote: > <tr onclick="GetDetail(this.rowIndex)"> > <td><xsl:value-of select="@trip_status"/></td> > <td><input name="test" type="checkbox"></input></td> > </tr> > </xsl:for-each> > > My problem is that I now need to pass in the column name that was > clicked (i.e. either the trip status or accepted trips checkbox) into > the GetDetail javascript method referenced in the onClick attribute > above. I cannot figure out how to reference that name. I've tried > this.colName, this.name, etc with no luck. That is not really a problem with XSLT as you simply generate a HTML document with client-side script and need to learn how to use DOM scripting and event handling. To solve the problem you need to use the event object and check its srcElement property for IE and the target property for other browsers e.g. <tr onclick="GetDetails(this, event);"> then have a function function GetDetails (row, evt) { var srcElement = evt.srcElement || evt.target; then extract the details from srcElement you are looking for. If you have further questions then ask them in one of the J(ava)Script scripting groups. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
