Monthly Archives: July 2013

How to make a JSON object with PHP array for jQuery autocomplete?

This php code creates JSON object like ” availableTags “

$Acc_Name_List is your PHP array which have key and value. You can manipulate as you want, make function or add into your class.


JQuery – how to get a key and value with autocomplete?

Jquery autocomplet is easy but when you have to get the key of the array and store into the database or just you want to get it’s a bit tricky.
I have used the jquery UI autocomplete feature with JSON object which you can create with given PHP code.
As soon as you choose a list of the values, key automatically gets populated into another hidden field. For sake of understanding I made it text field.
You can do whatever you want with that id!!


How to pass dropdown value to text box ?

I had a situation where requirement was to pass select box value to another text field. Using jQuery it is very easy.

See the code below.


How to pass dropdown name to text box ?

Select a dropdown name and pass value to another text field is very easy using jquery.