0

I have 2 fields on the form, Fruits and FruitVarieties.

I need to populate an Array based on the Fruit value. This array is then used to AutoComplete Fruit Varieties. The array values are selected from a MySQL DB using Perl. What is the best way to populate this array using jQuery/AJAX?

1
  • google the jQuery Autocomplete logic Commented Mar 11, 2011 at 9:36

2 Answers 2

1

This example of jquery autocomplete with perl may get you started: http://www.jensbits.com/2011/05/09/jquery-ui-autocomplete-widget-with-perl-and-mysql/

Sign up to request clarification or add additional context in comments.

2 Comments

The link appears to be dead at the moment - what did it say?
@RowlandShaw the link is fine. Just loaded it.
-1

You need a script on the server that will output the fruit varieties in JSON format given a fruit. This script will be used by an autocomplete plugin for jQuery (such as jQuery UI autocomplete for instance)

See this SO question for some links and explanations.

2 Comments

I have a Perl script on the server that returns an array of hashes from the database. How do I convert it to JSON fromat (the array has an Id, Name)
Look for the autocomplete plugin and see the format it expects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.