[xsl] why can not acces form element in javascript function from xsl rendered html?

Subject: [xsl] why can not acces form element in javascript function from xsl rendered html?
From: "Bhattachan, Ganesh" <Ganesh.Bhattachan@xxxxxxxxxx>
Date: Fri, 7 Mar 2003 09:06:23 -0700
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


Current Thread