Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    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

    (@nick-van-bakel)

    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

    (@nick-van-bakel)

    I don’t know how to solve it. I hope you can.

    Plugin Author Michael Simpson

    (@msimpson)

    Replace the options tags with a cfdb-html shortcode that generates those option tags.

    Thread Starter Nick van Bakel

    (@nick-van-bakel)

    can you give me an example please? i’m new with the plugin?

    Plugin Author Michael Simpson

    (@msimpson)

    <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

    (@nick-van-bakel)

    This is what it displays:
    http://prntscr.com/96otqk

    This is my database:
    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

    (@msimpson)

    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

    (@nick-van-bakel)

    <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

    and i don’t know why…

    Thread Starter Nick van Bakel

    (@nick-van-bakel)

    I hope that you can help me Michael! it would be great if it could work!

    Plugin Author Michael Simpson

    (@msimpson)

    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

    Thread Starter Nick van Bakel

    (@nick-van-bakel)

    Thanks Michael, it works now!

    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

    Plugin Author Michael Simpson

    (@msimpson)

    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.