This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Drop Down List do not create when more elements added Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Drop Down List do not create when more elements added" Watch "Drop Down List do not create when more elements added" New topic
Author

Drop Down List do not create when more elements added

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 437
Good day All,

i using PHP for the project to create a SELECT/Drop down for the Country and state



Code to create Drop-down list and i putting this way


FYI, fillCategory() in fact is a function with PHP code which get the value from database. the value here are where i captured from Firefox error console, the strange case here is if i have put limitation for DB query like "SELECT * from country limit 10" , then it will generate the Drop down list but not the case of full list.

Can any expert here point out what's wrong on my JS script ?

thank you for your guidance !
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6


Change to



I personally would do it like this:


Eric
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 437
Thanks Eric for the guidance

i just have 1 more question, by looking at the code below



Why we do not need to increment the length of the options and it will allow continue add on new option
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15357
    
    6
You are adding an option to the next available position in the list. Just like how you add a new option to an array.

Eric
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Drop Down List do not create when more elements added
 
Similar Threads
Fetching values from database and populating it in drop down and text fields
JSP variable typical problem
Problem with mozilla firefox browser while creating dynamic dropdown list
putting values from ArrayList to optionlist/dropdownlist
Dynamic drop down list from an array