Click to See Complete Forum and Search --> : Populating Lists.


urxlnc
01-18-2003, 11:47 AM
Hi,

Thanks for the help, i also need some help with this.

There are about 93 Books, in 9 Volumes.

Volume 1 Books 1-12
Volume 2 Books 13-26
Volume 3 Books 27-50
Volume 4 Books 51-56
Volume 5 Books 57-59
Volume 6 Books 60-61
Volume 7 Books 62-72
Volume 8 Books 73-82
Volume 9 Books 82-93

First a dropdown list of 9 Volumes,(default is All Volumes)

Now there is name for every books like
1. A
2. B
3. C.....

When we change the list in Volumes the corresponding Book names to be populated in another dropdown list. If it is "All Volumes" is selected then all the Books names should be populated in the Books drop down list.


Thanks in advance.

khalidali63
01-18-2003, 01:00 PM
Try the solution attached in a zip file,Hope this answers your question

cheers

Khalid

urxlnc
01-18-2003, 11:55 PM
:D Thanks a lot khalidali.

urxlnc
01-19-2003, 12:17 AM
Thanks for your help but there are some bugs, when I run it its giving me different book numbers, for example.

All Volumes --> Runs Well gives all books
Volume 1 -->Runs Well gives for 1 -12
Volume 2 -->Errors, not generating list from book Not generating Books 13-26 but Books 1-14
Volume 3 -->Errors, not showing 27-50 but Books 1-24
and also errors for remaining volumes, please try to create array for book names.

And Khalid please give me your email, I have to send you something, reply at shaikimranahmed@hotmail.com.

khalidali63
01-19-2003, 12:22 AM
oh ..ok..by the way that is not bug thats how it works,I guess you want there actual sequence numbers instead of and index from zero to n?

Khalid

khalidali63
01-19-2003, 12:28 AM
Here you go

locate this function in the javascript code

function createDynamicList(start, end)

and replace the whole function with the code below

function createDynamicList(start, end){
var listBox2 = document.form1.bookList2;
listBox2.style.visibility="visible";
listBox2.length = (end-start)+2;
var range = listBox2.length;
listBox2.options[0].text = "Select All";
listBox2.options[0].value = "-1";
var s=0;
for(x=start;x<end+1;x++){ //make changes below to print book names only.
s++;
listBox2.options[s].text = bookDescription+x;
listBox2.options[s].value = bookValue+x;
}
}