I am trying to create a module to register for an online course. It involves the students to input their name, address, email address and name of the school. Currently they are just text fields using the forms api. The problem is that a lot many a times, students from the same school enter the name of school in different manner and as such, one school is stored in the database under multiple names. This becomes an issue if i try to search for a school as not all the entries would come up.
I was thinking if it was possible to have an autocomplete text box similar to the autocomplete used in live search in drupal and the search box in browsers (top right) ..
has this been done by anyone ? can anyone help me out with this ??
thanks a lot. your help is well appreciated.
Comments
It's simple with form API.
It's simple with form API. You must have set autocomplete path with autocomplete function callback in your hook_menu() .
And in your form:
And autocomplete function which search city in table cities looks like:
Something looks like this working for me (Drupal 5 offcourse). Here is full article but only in Slovak language (sorry) :). http://www.fem.uniag.sk/havran/blog/ako-v-drupale-na-funkciu-autocomplete
--
My blog - Havran's mini-blog
My first drupal site - http://www.enigma.sk/
--
My site - Svoji.SK
My first Drupal site - http://www.enigma.sk/
yes, it is so simple
Yes, it does so simple.
thank you so much.
Reply-
Hi Dear
Thanks for your code snippet,
My doubt is totally different , here is my doubt
Hi
I know how to create the custom blocks,
I have followed the pro-drupal development pdf , for creating custom block,
when we create the custom module at end of block module we have to call the theme function for display the block,
for that , in the pdf tutorial , they used item-list function,
so , i make another copy of the item_list function ,(which is located in the theme.inc)
then i simply changed name of the item_list function to myblock_itme_list ,
But i am not sure my way is correct,
Here i need your help, can u please give me your custom block snippet,
It is very much useful for my development,
Thanks
Expand the width of the autocomplete field
I have a textfield that is '#size' => 5, and the value to enter is a five character value. I use the autocomplete to bring back a list of values and the related description (e.g. 10000 - General Fund). However, the autocomplete field is displaying the same width as the textfield. How can I make the autocomplete field wider without making the textfield wider?
I have played with the css to little avail, although I did notice that when I placed the following, the list element was wider, but the text and background did not fill the list element's width.
Test Autocomplete form
Click here : Test Autocomplete form
Regards,
Veera Prasad Dagudu
How to create Custom Autocomple search step by step
How to create Custom Autocomple search step by step:
check given link: Custom Autocomple search
http://www.letmecrazy.com/drupal-7-custom-search-autocomplete-using-form...