• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

XSL and Javascript

Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to include my code for you to have a look at. I'm trying to create two multi-select boxes that can pass values back and for (move, moveall, remove, removeall)... that sort of thing. I am doing this using JSP, XML and XSL. Everything compiles successfully, but I am getting an 'Error on page' error in my status bar whenever I click one of the buttons. I'm so new to all this that I'm not sure where I'm suppose to be putting the Javascript. Please take and look and let me know what you think the problem might be.
My JSP page:
<?xml version = "1.0"?>
<%@ page contentType="text/html;charset=WINDOWS-1252"%>
<script language="JavaScript"><!--
function deleteOption(object,index) {
object.options[index] = null;
function addOption(object,text,value) {
var defaultSelected = true;
var selected = true;
var optionName = new Option(text, value, defaultSelected, selected)
object.options[object.length] = optionName;
function AlertBox1(){
alert("You have clicked the first button.")
function copySelected(fromObject,toObject) {
for (var i=0, l=fromObject.options.length;i<l;i++) {
if (fromObject.options[i].selected)
for (var i=fromObject.options.length-1;i>-1;i--) {
if (fromObject.options[i].selected)
function copyAll(fromObject,toObject) {
for (var i=0, l=fromObject.options.length;i<l;i++) {
for (var i=fromObject.options.length-1;i>-1;i--) {
<jsp:useBean class="oracle.jbo.html.databeans.XmlData" id="custQuery" scope="request" >
My XSL Page:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<table border = "0" width ="50%" cellpadding = "0" cellspacing = "0">
<tr align="left">Choose a telephone number</tr>
<td align="left"></td>
<tr align="left"></tr>
<td><select name="select1" multiple="true" size="8" >
<xsl:for-each select="Results/CustomerView">
<option><xsl:value-of select= "Phone"/></option>
<input type="button" value=" move one " onClick="if (document.images) copySelected(this.form.select1,this.form.select2)"></input>
<p align="left"></p>
<input type="button" value=" remove one " onClick="if (document.images) copySelected(this.form.select2,this.form.select1)"></input>
<p align="left"></p>
<input type="button" value="move all" onClick="if (document.images) copyAll(this.form.select1,this.form.select2)"></input>
<p align="left"></p>
<input type="button" value="remove all" onClick="if (document.images) copyAll(this.form.select2,this.form.select1)"></input>
<select name="select2" multiple="true" size="8">
Thanks so much for any help....
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!