...

View Full Version : Javascript for dynamic listbox



steamngn
10-20-2006, 07:32 PM
Hi gang!
Is there a fairly simple javascript I can use to dynamically populate a listbox? I have a record update page on our intranet web site and some of the fields need to be literal lookups of columns in our SQL database. Any ideas for this java wannabe?:D
Andy

g_mollies
10-21-2006, 08:08 AM
Since you are going to do a lookup on database you can use AJAX.
To populate the list box dynamically.



var i=forms[0].listbox.length;

forms[0].lisbox.options[i].text="something1";
forms[0].lisbox.options[i].value="something1";
i++;
forms[0].lisbox.options[i].text="something2";
forms[0].lisbox.options[i].value="something2";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum