Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing a checkbox value to the to listbox

Status
Not open for further replies.

kann

Programmer
Feb 16, 2000
25
0
0
US
Hai,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I Have the list of checkbox.when the checkbox is checked(default)the value is to be passed in to the listbox.if the any checkbox is unchecked.The Corresponding checkbox value should be removed from the list box.<br><br>I would Appreciate if u can give some idea&nbsp;&nbsp;<br><br>kann<br>
 
Just use the onClick event handler of the checkbox. Test to see if it it now checked or unchecked. Then remove the option from the list box... <br><br><A HREF="mailto:jared@aauser.com">jared@aauser.com</A>
 
thanks,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I finally got the solution.<br><br>
 
Hi,
I would Appreciate if any one can give some idea.I have two list boxes in my form. One is populating from the databse and second is for user, can selected itemsfrom first. I used two buttons to add and remove from the second. (both are mutiselect, user can add or remove from second )I kept all first box option values as id(pk, number) and text as name. I used onclick event for the button. When i adding to second, upto 50 records it is ok, after that it is not properly added to the second. When i see the values of options, they are same as what they should be in Database/view source.
here is my code

function addToList(){
array_value=new Array()
array_value[0]=0
var count=1
<!-- first i am getting the existing values from second,first option i kept as constant-->
for(var i=1;i<15;i++){
if(document.school.webschool.options.value > 0 ){
array_value=document.school.webschool.options.value;
}
}

for(var x=1;x <document.school.availableschool.options.length;x++){
if(document.school.availableschool.options[x].selected){
array_value=array_value.concat(document.school.availableschool.options[x].value
count++
}

if(count > 15){
alert(&quot;You can update only 15 Record at a time&quot;);
break
}
}


var a,b;
array_value.sort(function(a,b){return a-b;});

if (array_value.length >1){
for(var y=1; y <array_value.length; y++){
document.school.webschool.options[y].value=array_value[y];


document.school.webschool.options[y].text=document.school.availableschool.options[array_value[y]].text;

}
}
} [sig][/sig]
 
Hi,
I have a doubt in Jscript.Can we delete a element in an array.
Suppose i have an array called myarray=[1,4,5,6,8,9]
how can i delete element at maarray[2].
when i try to delete i am getting an array of[1,4,,6,8,9]
is there any way to get array of [1,4,6,8,9]
thanks [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top