Problem

HI,I have java script code that i m using in my jsp its working fine,but when i m using same javascript code and calling same jsp by struts its not working. Please try to resolve the problem.Thanks in advance,Vikas
[249 byte] By [vic.guptaa] at [2007-11-27 6:06:13]
# 1

Also i m giving code which i used,

<script>

var selectedList;

var availableList;

function createListObjects(){

availableList = document.getElementById("availableOptions");

selectedList = document.getElementById("selectedOptions");

}

function delAttribute(){

alert("Hello2") ;

var selIndex = selectedList.selectedIndex;

if(selIndex < 0)

return;

availableList.appendChild(selectedList.options.item(selIndex))

selectNone(selectedList,availableList);

//setSize(availableList,selectedList);

}

function addAttribute(){

var addIndex = availableList.selectedIndex;

if(addIndex < 0)

return;

alert("Hello222") ;

selectedList.appendChild(availableList.options.item(addIndex));

selectNone(selectedList,availableList);

//setSize(selectedList,availableList);

}

function delAll(){

alert("Hello") ;

var len = selectedList.length -1;

for(i=len; i>=0; i--){

availableList.appendChild(selectedList.item(i));

}

selectNone(selectedList,availableList);

//setSize(selectedList,availableList);

}

function addAll(){

alert("Hello") ;

var len = availableList.length -1;

for(i=len; i>=0; i--){

selectedList.appendChild(availableList.item(i));

}

selectNone(selectedList,availableList);

//setSize(selectedList,availableList);

}

function selectNone(list1,list2){

list1.selectedIndex = -1;

list2.selectedIndex = -1;

addIndex = -1;

selIndex = -1;

}

function setSize(list1,list2){

list1.size = getSize(list1);

list2.size = getSize(list2);

}

function getSize(list){

/* Mozilla ignores whitespace, IE doesn't - count the elements in the list */

var len = list.childNodes.length;

var nsLen = 0;

//nodeType returns 1 for elements

for(i=0; i<len; i++){

if(list.childNodes.item(i).nodeType==1)

nsLen++;

}

if(nsLen><2)

return 2;

else

return nsLen;

}

function showSelected(){

var optionList = document.getElementById("selectedOptions").options;

var data = '';

var len = optionList.length;

for(i=0; i<len; i++){

if(i>0)

data += ',';

data += optionList.item(i).value;

}

alert(data);

}

vic.guptaa at 2007-7-12 16:21:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Too much unformatted code.What about it is not working? An Error? An Exception?You're not trying to call java code from a javascript event are you?
evnafetsa at 2007-7-12 16:21:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...