[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: why can not acces form element in javascript funct

Subject: RE: why can not acces form element in javascript function from xsl rendered html?
From: "Marty McKeever" <marty.mckeever@xxxxxxxxxx>
Date: Fri, 7 Mar 2003 11:50:48 -0500
javascript form element
the only reason the form object would not be available is if you pass it in
oncorrectly.
either of these should work for you:

<input type="button" onclick="selectAll('someID',this.form)"/>

or, if the onclick is not part of a form element, retrieve the object
directly:

<a href="#" onclick="selectAll('someID',document.forms['formName'])">





> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Bhattachan,
> Ganesh
> Sent: Friday, March 07, 2003 11:06 AM
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  why can not acces form element in javascript function
> from xsl rendered html?
>
>
> I have been trying to create a button  [e g. select all] that
> will select same value in select boxes/ radio buttons at a time
> that are created by using xsl/xml. I call javascript function
> selectAll on onClick() envent but can not access form element
> from function, and throws null or not an object error. I assign
> name to each select box dynamically
> so as to have unique id for each select box in each row.
>
> function selectAll( listID, form) {
> 	//listID is an arrayList with list of IDs.
> 	for ( i = 0; i<listID.length; i++)
> 	  // since each row in a table has select box, I use
> currency_uniqueRecordID(eid fetched from database)  as id for
> select boxes when
> 	  // rendering in html during xml-xsl transformation.
> 	  var selectBox = 'currency_' + listID[i]; //name assigned
> for select box when rendering html
> 	 //---this is not working. I have two options in each
> select box...US and EUR, and want to select US value in all dropdown.
> 	  form.selectBox.options[1].selected = true;
> 	}
> }
> The problem here is that the form element is not recognizable
> from javascript. Any help will be appreciated.
> Thanks in advance.
>
> GB
>
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.