Author Topic: Instant writting in a field  (Read 1591 times)

0 Members and 2 Guests are viewing this topic.

Offline poscore

  • Serf
  • *
  • Posts: 39
  • Cookies: -2
  • Have a nice day :)
    • View Profile
Instant writting in a field
« on: August 01, 2012, 01:15:15 pm »
Hello, i am delevoping a PHP project using HTML, PHP, MySQL, CSS. I have a field like a dropdown menu where the options are taken from a database. They just told me that there could be 500 options too. So i can not leave it like this! :D It would be perfect to have a input field where the user start writing some text and it instant filter the results. Something like google instant search. I hope this is clear! :)


The problem is that i have no idea of jquery or javascript :/ Could someone help me out? Maybe give me a link or code or some other help? :/


Thank you guys :)
« Last Edit: August 01, 2012, 01:16:12 pm by poscore »
Just asking and saying my opinion... :)

Offline Phage

  • VIP
  • Overlord
  • *
  • Posts: 1280
  • Cookies: 120
    • View Profile
Re: Instant writting in a field
« Reply #1 on: August 01, 2012, 03:33:19 pm »
« Last Edit: August 01, 2012, 03:34:26 pm by Phage »
"Ruby devs do, in fact, get all the girls. No girl wants a python, but EVERY girl wants rubies" - connection

"It always takes longer than you expect, even when you take into account Hofstadter’s Law."

Offline poscore

  • Serf
  • *
  • Posts: 39
  • Cookies: -2
  • Have a nice day :)
    • View Profile
Re: Instant writting in a field
« Reply #2 on: August 01, 2012, 03:49:43 pm »
I hope this works. I' ll try this tommorw and update the post.
Just asking and saying my opinion... :)

Offline poscore

  • Serf
  • *
  • Posts: 39
  • Cookies: -2
  • Have a nice day :)
    • View Profile
Re: Instant writting in a field
« Reply #3 on: August 01, 2012, 07:50:44 pm »
Well, itried something at my local server and basically i think this does not work for me. You have to Submit the form so as to get some output data right? I would like as the user writes in the form automatically it searches the database. :/ I hope my question is clear :/
Just asking and saying my opinion... :)

Offline Phage

  • VIP
  • Overlord
  • *
  • Posts: 1280
  • Cookies: 120
    • View Profile
Re: Instant writting in a field
« Reply #4 on: August 01, 2012, 09:32:40 pm »
If that doesn't work i do only see these two options. I think this is the closest you will get. There might be a solution, but i do not know about it.


http://www.w3schools.com/php/php_ajax_livesearch.asp

http://jqueryui.com/demos/autocomplete/


But i do not think you will be able to get it 100% like Google did with their instant search function.
« Last Edit: August 01, 2012, 09:40:11 pm by Phage »
"Ruby devs do, in fact, get all the girls. No girl wants a python, but EVERY girl wants rubies" - connection

"It always takes longer than you expect, even when you take into account Hofstadter’s Law."

Offline poscore

  • Serf
  • *
  • Posts: 39
  • Cookies: -2
  • Have a nice day :)
    • View Profile
Re: Instant writting in a field
« Reply #5 on: August 01, 2012, 11:55:37 pm »
Ok, ill definitely gonna program this function according to the new links and the old one. One more source is in phpacademy.org about jQuery Tutorial.thank you for your help
« Last Edit: August 01, 2012, 11:56:15 pm by poscore »
Just asking and saying my opinion... :)

Offline Phage

  • VIP
  • Overlord
  • *
  • Posts: 1280
  • Cookies: 120
    • View Profile
Re: Instant writting in a field
« Reply #6 on: August 02, 2012, 09:02:03 am »
No problem, I'm glad i could help.
"Ruby devs do, in fact, get all the girls. No girl wants a python, but EVERY girl wants rubies" - connection

"It always takes longer than you expect, even when you take into account Hofstadter’s Law."