We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22216
    • 8 Posts
    Hi,

    I have a problem to display a Placeholder value with eForm.
    If I call the chunk itself, the value is displayed.
    If I use eForm to call this chunk, all the different values of the input text are displayed ... but not the one from the textarea ... Why?

    Manhy thanks in advance for your help!

    Max
      • 22216
      • 8 Posts
      I will add more precision.

      Here is the resource page where the chunk is called:
      [!SelectEvent!]
      
      [!UpdateEvent!]
      
      {{EventForm}}
      
      [!eForm? &noemail=`true` &formid=`EventForm` &tpl=`EventForm` &thankyou=`53`&eFormOnBeforeMailSent=`UpdateEvent` &allowhtml=`1`  !]
      


      and here is the chunk:
      [+validationmessage+]
      Date: [+date+]<br>
      Corps: [+contenu+]<br>
      Auteur: [+author+]<br>
      Titre: [+title+]<br>
      
      <form method="post" action="[~[*id*]~]" id="EventForm" name="EventForm" enctype="multipart/form-data">
      <fieldset>
      <input name="formid" type="hidden" value="EventForm"/>
      <table >
        <tr>
          <td class="tableclass">Subject:</td>
          <td><input name="title" id="cfTitle" class="text" type="text" value="[+title+]"  eform="Subject::1:"/></td>
        </tr>
        <tr>
        <td>Content:</td>
        <td><textarea name="contenu" id="cfContenu" class="text" eform="Message::1:">[+contenu+]</textarea></td> 
        </tr>
        <tr>
        <td>Event Date:
        <td><input name="date" id="cfDate" class="text" type="text" value="[+date+]" eform="Date::1:" /></td> 
        </tr>
        <tr>
        <td>Author:
        <td><input name="author" id="cfAuthor" class="text" type="text" value="[+author+]" eform="Author::1:" /></td> 
        </tr>
        <tr>
        <td><input type="submit" name="validate" id="cfValidate" class="button" value="Validate" /></td>
        </tr>
      </table>
      </fieldset>
      </form>
      


      As you can see, I have tested to get the value in and out the form. Both have the same result, the value is well displayed if the chunk is called directly. But not if it is called from the eForm line ...

      Do you have any idea?

      Many thanks,

      Max

        • 10165
        • 129 Posts
        Hi Max,

        I’m having the same issue, I can’t populate a text area "message"

        If I add another input for message below the textarea:

        <label for="cfMessage">Message:
        <p><textarea name="message" id="cfMessage" eform="Message:textarea:1>[+message+]</textarea></p></label>
        <p><input name="message" id="cfMessage" type="text" value="[+message+]" eform="Message::1" /></p>

        then it populates the textarea!
          • 22216
          • 8 Posts
          Many thanks!

          But, don’t you see twice the content? Once in the Textarea and the second time in the input?

          Regards,

          Max
            • 10165
            • 129 Posts
            It seems to work OK if you disable the extra field: ( disabled="disabled" )

            <label for="cfMessage">Message:
            <p><textarea name="message" id="cfMessage" eform="Message:textarea:1>[+message+]</textarea></p></label>
            <p><input name="message" disabled="disabled" id="cfMessage" type="text" value="[+message+]" eform="Message::1" /></p>

            this gets the placeholder value into the form but as it’s disabled your form then uses the textarea for the update - seems to be working for me..
              • 22216
              • 8 Posts
              Thanks for this proposal, but I cannot afford to have two fields, one textarea and one input, with the same content inside.
              And if I apply type="hidden", then the content from the textarea disappear ...

              Is it a bug in MODx?

              Thanks for your attention,

              Max
                • 19252
                • 9 Posts
                I am having the same issue that the value for the placeholder will not populate in the textarea.

                When I use this outside of eForm the textarea populates correctly with the placeholder value. When using the suggested method of adding another text input that is disabled, it still will not populate in the textarea.

                Here is the code:
                <textarea name="quoteText" id="quoteText" eform="quote:textarea:1:Only letters, numbers and punctuation allowed:#REGEX /^[A-za-z0-9' ,!?\.-]+$/">[+editQuoteText+]</textarea>
                        <br /><input name="quoteText" id="quoteText" disabled="disabled" type="text" value="[+editQuoteText+]" eform="quote::1" />


                any ideas to get this to work? undecided