frozenpeas
Technical User
Hello,
I searched the forum and FAQ section for help on this but came up empty.
Each select item in my dynamically generated drop down is followed by a blank one. For example it looks like:
I cannot determine what is causing this. My menu generating code is currently:
the output I am assigning to the array looks good:
I have also tried generating the menu with this loop but have the same result:
Any ideas as to what is causing the blank selects?
Thanks.
frozenpeas
--
Micfo.com Affiliate Program
I searched the forum and FAQ section for help on this but came up empty.
Each select item in my dynamically generated drop down is followed by a blank one. For example it looks like:
Code:
Please select...
(option 1)
( )
(option 2)
( )
(option 3)
( )
(option 4)
I cannot determine what is causing this. My menu generating code is currently:
Code:
pairCount = results.length/2;
document.entries_form.subcat_id.length = pairCount;
for (i=0; i<results.length; i++){
if((i%2)==0){
//even
document.entries_form.subcat_id[i].text = results[i];
document.entries_form.subcat_id[i].value = results[i+1];
}else{
//odd
document.entries_form.subcat_id[i+1].text = results[i+1];
document.entries_form.subcat_id[i+1].value = results[i+2];
}
}
the output I am assigning to the array looks good:
Code:
Bed & Breakfast|1|Boutique Hotel|2|Conference Centre|3|Furnished Apartments|4|Hotel - Large Scale|5|Hotel - Mid-Sized|6|Other|8|Staff Accommodations|7|
I have also tried generating the menu with this loop but have the same result:
Code:
document.entries_form.subcat_id.length = results.length/2;
for (i=0; i<results.length; i+=2){
document.entries_form.subcat_id[i].text = results[i];
document.entries_form.subcat_id[i].value = results[i+1];
}
Any ideas as to what is causing the blank selects?
Thanks.
frozenpeas
--
Micfo.com Affiliate Program