We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12320
    • 88 Posts
    HI
    i’ve tried to popullate a list from a ditto and fixed value too
    it works fine on user side, my list seems good.
    but after form validation, only fixed values are allowed by the eform, which returning error :
    ’paillasse’ Failed using rule: #LIST Aucun, (input=Paillasse de laboratoire assise sous flux laminaire)

    let me show you my code:
    <select name="paillasse" size="5" multiple="multiple" id="paillasse">
    [[Ditto? &startID=`26` &summarize=`99` &sortDir=`ASC` &tpl=`list_option` &language=`francais` ]]
    <option value="Aucun">Aucun</option>
    </select>


    this code return :
    <select name="paillasse" size="5" multiple="multiple" id="paillasse" class="invalid">
    <option value="Paillasse de laboratoire pour acide, base ou solvant">Paillasse de laboratoire pour acide, base ou solvant</option>
    <option value="Paillasse de laboratoire assise sous flux laminaire">Paillasse de laboratoire assise sous flux laminaire</option>
    <option value="Paillasse de laboratoire sous flux laminaire">Paillasse de laboratoire sous flux laminaire</option>
    <option value="Paillasse de laboratoire pour acides, bases ou solvant sous extraction">Paillasse de laboratoire pour acides, bases ou solvant sous extraction</option>
    <option value="Hotte d'extraction universelle pour laboratoire ">Hotte d'extraction universelle pour laboratoire </option>
    <option value="Hotte d'extraction horizontale pour laboratoire acide, base, solvant">Hotte d'extraction horizontale pour laboratoire acide, base, solvant</option>
    <option value="Hotte d'extraction verticale pour laboratoire acide, base, solvant">Hotte d'extraction verticale pour laboratoire acide, base, solvant</option>
    <option value="Hotte d'extraction pour laboratoire acide, base, solvant">Hotte d'extraction pour laboratoire acide, base, solvant</option>
    <option value="Aucun" >Aucun</option>
    </select>


    I’ve find a solution : change the validation RULE !
    It seems that the generated code is not in the liste of allowed values ...
    it looks like a bug ...

    any better idea to unlock this schema ?


      Thanks to the authors of the following code :
      Easy Newsletter (module)
      SiteMap (snippet)
      Codepress (Plugins)
      Strict URLs (Plugins)
      Virtual Aliases (Plugins)
      Maxygallery (snippet)
      • 12320
      • 88 Posts
      i’ve got a clue :

      according to the documentation : eform="[description/title]:[datatype]:[required]:[validation message]:[validation rule]"

      so here is the code :
      <select name="paillasse" size="5" multiple="multiple" id="paillasse" eform="title:string:0::#FILTER #LIST badword||goodword">


      But it doesn’t send the multiple value by this way ...
        Thanks to the authors of the following code :
        Easy Newsletter (module)
        SiteMap (snippet)
        Codepress (Plugins)
        Strict URLs (Plugins)
        Virtual Aliases (Plugins)
        Maxygallery (snippet)
        • 30223
        • 1,010 Posts
        By placing the ditto call inside the form template it’s output doesn’t become available until after eForm has parsed the template. That is why you have validation problems. Teh best solution would be to replace the ditto call with a placeholder and use the eFormOnBeforeFormParse event to call ditto in code. Use runSnippet() in the event function and replace the said placeholder in your form template with it’s results.

        The reason you are not getting multiple values returned is because you missed placing square brackets after the select name. The brackets ensure that php translates the form input into an array. see below...

        <select name="paillasse[]" size="5" multiple="multiple" id="paillasse">
        [+ditto_output+]
        <option value="Aucun">Aucun</option>
        </select>


          • 12320
          • 88 Posts
          very nice to you gentleman !
            Thanks to the authors of the following code :
            Easy Newsletter (module)
            SiteMap (snippet)
            Codepress (Plugins)
            Strict URLs (Plugins)
            Virtual Aliases (Plugins)
            Maxygallery (snippet)