- Aditya Webservices Blog
- Aditya Webservices Blog
Aditya Keyal wrote:currently the code that you have written returns the objectId of an array. Thats meaningless to the <select>. Your code must change a lot.
Instead of the array use a string buffer. and change the code as shown:
eyBear Bibeault wrote:What made you think value would be appropriate? That holds the value of the control.
Employ DOM manipulation, innerHTML, or the API for the Select element.
Bear Bibeault wrote:Select element API: http://java.sun.com/j2se/1.4.2/docs/guide/plugin/dom/org/w3c/dom/html/HTMLSelectElement.html
Be aware that IE doesn't follow this standard exactly.
Or, make it easy on yourself and employ jQuery which makes this sort of thing easier. If you download the code for my jQuery book from its web page you'll find examples of creating dynamic dropdowns in the Chapter 8 sample code
You can see the sample code in action here.
Regards,
Arpit Purohit
Arpit Purohit wrote:Try following Javascript code snippet (tested on IE6 and Firefox 3.0.8)
Deeps Mistry wrote:Also, i am using struts tag. So is it possible to create a <html:options> tag in javascript?