• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

load data automatically when mouse over the combobox

 
nad nadia
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello guys.. i am a beginner.. so i totally burr about tis.. so need yout help.. and if possible give me step by step..
the prob is..
I want to create a combo box which load its data automatically when user click the combo box. and the data is retrieve from database SQL, that means, once mouse over the combo box, it will call a function to load the data. If not, the combo box is remain empty.

thanks for any help.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would need to use AJAX for this.
Moving to the HTML/Javascript forum where AJAX is discussed.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That really is not a good idea.

It's going to take some time for the data to get read frm the database, so waiting until the user clicks on the select element (it's not a combobox) to try to go fetch its content is a very poor idea.
 
nad nadia
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
acctually... i just do whateva my boss need me to do...
actually our page sometimes have more than 30 drop down list in one page, so if every drop down request from database, its quite slow...
thanks for your advice, but i still need to do it,so, do know how to do it? thnaks
 
Tejas Tambe
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Nad,

I understand your requirement and as suggested by Ben, AJAX would be the best solution. But, if you do not want to use AJAX, then why not try to sell the concept of Lookup screen?

i.e. instaead of dropdowns, provide the user with a text box. Let user enter some value, or the initial alphabet of the value he/she is looking to select. Provide a link next to your text box as 'Look up' and then based on the value entered by user, retrieve the results in a new screen. User can then select a value from the displayed ones.

This will serve 2 things,
1. user gets refined data - he/she can search
2. you do not need to populate all the drop downs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic