Hello Monks

Well it's been 3 years since I was here last as I don't really like asking if I can fathom the problems out for myself but this time I'm well and truly stumped. Probably because my perl is still p. poor (although I feel I'm a little better than last time I was here) and I've sort of gleaned from my research that I need Javascript, JQuery and Json to accomplish what I am trying to do?. All of which I am completely clueless about

So basically my site works on a few perl scripts cobbled together and is a record selling platform very much like eBay but more specific. Users can sell their own records (45's) by completing a series of forms to enter (and post) the data. Seperately I have a mysql database which includes probably every 45 known of the particular genre about 60000 records.

The top part of the form encourages the user to enter the Artist's name, the Record Label and the Title of the record. Usually after adding some more details the form is submitted and saved to a flat file. What I want to be able to do is autocomplete the Artist, Label,Title bit with data from the mysql database. So the user types say 3 letters of the Artists name and a dropdown gives a choice of Artist based on their criteria. The Label input will then produce a dropdown list of all of the Labels the Artist has recorded on for selection and lastly the Title dropdown will include a list of all the titles the Artist has recorded. If the record is not in the database, I would like it to be written back to the database

So far the form obviously works to collect data for the flat file, the mysql connects and I have managed to extract Artist, Label and Title and assemble into a Json array, my question I suppose is what do I do now to autocomplete the form?

Thank you in advance for any help, suggestions or code you may proffer Dazz

In reply to Auto completing a form from and to a mysql database by Dazz45X

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.