Title: Autofill from database
Last modified: August 30, 2016

---

# Autofill from database

 *  [Nick van Bakel](https://wordpress.org/support/users/nick-van-bakel/)
 * (@nick-van-bakel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/)
 * Is is possible to get value out of the database and autofill it in an textfield?
 * [https://wordpress.org/plugins/contact-form-7-to-database-extension/](https://wordpress.org/plugins/contact-form-7-to-database-extension/)

Viewing 14 replies - 1 through 14 (of 14 total)

 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778633)
 * Where ever you would put the autofill value in HTML, you could put in a [cfdb-
   value] or [cfdb-html] short code that selects the value you want.
 *  Thread Starter [Nick van Bakel](https://wordpress.org/support/users/nick-van-bakel/)
 * (@nick-van-bakel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778665)
 * Sorry i meant autocomplete. i have looked on every forum but i can’t find it 
   anywhere.
 * It looks like this but i i don’t want the options i want to get the values out
   of the database do you know how?
 *     ```
       <input type="text" name="srch" id="srch" list="datalist1">
       <datalist id="datalist1">
         <option value="Canada">
         <option value="China">
         <option value="Mexico">
         <option value="United Kingdom">
         <option value="United States of America">
         <option value="Uruguay">
       </datalist>
       ```
   
 *  Thread Starter [Nick van Bakel](https://wordpress.org/support/users/nick-van-bakel/)
 * (@nick-van-bakel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778668)
 * I don’t know how to solve it. I hope you can.
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778695)
 * Replace the options tags with a cfdb-html shortcode that generates those option
   tags.
 *  Thread Starter [Nick van Bakel](https://wordpress.org/support/users/nick-van-bakel/)
 * (@nick-van-bakel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778698)
 * can you give me an example please? i’m new with the plugin?
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778703)
 * <input type=”text” name=”srch” id=”srch” list=”datalist1″>
    <datalist id=”datalist1″
   > [cfdb-html form=”formname”] <option value=”${country}”> [/cfdb-html] </datalist
   >
 * Change formname and country
 *  Thread Starter [Nick van Bakel](https://wordpress.org/support/users/nick-van-bakel/)
 * (@nick-van-bakel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778719)
 * This is what it displays:
    **[http://prntscr.com/96otqk](http://prntscr.com/96otqk)**
 * This is my database:
    **[http://prntscr.com/96otwt](http://prntscr.com/96otwt)**
 * And this is my code:
 *     ```
       Salesorder:
               <input type="text" name="srch" id="srch" list="datalist1">
                 <datalist id="datalist1">
                   [cfdb-html form="Contact"]
                   <option value="${Salesorder}">
                   [/cfdb-html]
                 </datalist>
       ```
   
 * I don’t know what’s wrong with the code.
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778729)
 * I find that works for me if I just copy-past and change the form and field name
   for something I have. It looks like WP is not parsing the short code correctly.
 * Try pasting the short code again. Be in “Text” mode in your WP editor. Also try
   putting all of the short code parts on one line with no line breaks.
 *  Thread Starter [Nick van Bakel](https://wordpress.org/support/users/nick-van-bakel/)
 * (@nick-van-bakel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778737)
 *     ```
       <p>Bestand toevoegen:<br />
           [file* Bijlage limit:100000000 filetypes:jpg|jpeg|png|gif|pdf|doc|docx|ppt|pptx|odt|avi|ogg|m4a|mov|mp3|mp4|mpg|wav]</p>
   
       <p>Verkoper:
           <select name="Verkoper" id="text">
                 <option value="Ted de Goey">Ted de Goey</option>
                 <option value="Jeroen van der Zouwen">Jeroen van der Zouwen</option>
                 <option value="Martin Nagtegaall">Martin Nagtegaal</option>
                 <option value="Jan Kooman">Jan Kooman</option>
                 <option value="Reinier Domhoff">Reinier Domhoff</option>
                </select>
   
       <p>Klantnaam:
         <input type="text" id="text" name="Klantnaam" placeholder="Klantnaam"></p>
   
       <p>Gender:
           <input type="radio" name="HeerMevrouw" value="heer"> heer
           <input type="radio" name="HeerMevrouw" value="mevrouw"> mevrouw</p>
   
       <p>Email address:
          <input type="text" id="text" name="emailaddress" autocomplete="on" placeholder="Email"></p>
   
       Salesorder:
       <input type="text" name="Salesorder" id="text" list="datalist1">
       <datalist id="datalist1">
       [cfdb-html form="Contact"]<option value="${Salesorder}">[/cfdb-html]
       </datalist>
   
       <p>Ref.POklant:
           <input type="text" id="text" name="Ref.POklant" placeholder="Ref.POklant"></p>
   
       <p>Eindgebruiker:
           <input type="text" id="text" name="Eindgebruiker" placeholder="Eindgebruiker"></p>
   
       Preview: [textarea Preview "Bedankt voor uw bestelling. Bijgesloten vind u de opdrachtbevestiging, controleer a.u.b. of deze correct is.
       Uw bestelling zal zo spoedig mogelijk verwerkt worden."]
   
       <p>[submit "Verzenden"]</p>
       ```
   
 * It won’t work this is my full code i hope you can do something with it.
 * It keeps displaying this:
    [http://prntscr.com/96otqk](http://prntscr.com/96otqk)
 * and i don’t know why…
 *  Thread Starter [Nick van Bakel](https://wordpress.org/support/users/nick-van-bakel/)
 * (@nick-van-bakel)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778738)
 * I hope that you can help me Michael! it would be great if it could work!
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778744)
 * Try it with single quotes inside the short code content:
 * `[cfdb-html form="Contact"]<option value='${Salesorder}'>[/cfdb-html]`
 * Might be related to: [https://www.gavick.com/blog/wordpress-shortcode-api-issues](https://www.gavick.com/blog/wordpress-shortcode-api-issues)
 *  Thread Starter [Nick van Bakel](https://wordpress.org/support/users/nick-van-bakel/)
 * (@nick-van-bakel)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-6778773)
 * Thanks Michael, it works now!
 *  [jalilachach](https://wordpress.org/support/users/jalilachach/)
 * (@jalilachach)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-8377989)
 * Hello have tried the code i am trying to autocomplete with answers previously
   submited from the same question
 * example
 * Food:
    <input type=”text” name=”Food” id=”text” list=”datalist1″> <datalist id
   =”datalist1″> [cfdb-html form=”Shop”]<option value=’${Food}’>[/cfdb-html] </datalist
   > i think its because of this error Error: [cfdb-html] tiene una plantilla vacía.
   No generará nada.(Opción específica del shortcode) Empty template. Doesnt generate
   something
 * ![HELP](http://edimid.com/wp-admin/admin-ajax.php?action=cfdb-file&s=1477944148.3879&
   form=COMPRAS&field=COPIADENOTA)
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-8378874)
 * I don’t see the problem. It might be a problem with quotes. I suggest to create
   the shortcode again from the shortcode builder page, test it there, and paste
   it on your page.

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Autofill from database’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/contact-form-7-to-database-extension_ffffff.
   svg)
 * [Contact Form DB](https://wordpress.org/plugins/contact-form-7-to-database-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-to-database-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/reviews/)

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [get](https://wordpress.org/support/topic-tag/get/)

 * 14 replies
 * 3 participants
 * Last reply from: [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/autocorrect-from-database/#post-8378874)
 * Status: not resolved