<" />
      <" />
        <"/>
        DEVHIDE
        • Home (current)
        • About
        • Contact
        • Cookie
        • Home (current)
        • About
        • Contact
        • Cookie
        • Disclaimer
        • Privacy
        • TOS
        Login Or Sign up

        Symfony 6, form textarea not posted after submiting the form

        103 Views Asked by Miguel Mejia At 02 January 2024 at 13:01 2025-12-02T18:34:22.566000

        I have simple contact form:

        <form id='contactform' action="{{ path('app_contact_send') }}" method="POST" name="contactform">
            <ul class="form-cover">
                <li class="inp-name">
                    <label>Nombre * (requerido)</label>
                    <input id="name" type="text" name="your-name">
                </li>
            <li class="inp-text">
                    <label>Mensaje * (requerido)</label>
                    <textarea id="mess" name="mess"></textarea>
                </li>
                <li class="inp-email">
                    <label>E-mail * (requerido)</label>
                    <input id="email" type="email" name="your-email">
                </li>
            </ul>
            <div class="btn-form-cover">
                <button id="#submit" type="submit" class="btn">enviar</button>
            </div>
        </form>
        

        After clicking the submit button I have a controller that gathers data from the from:

                $name = $request->request->get('name');
                $from = $request->request->get('email');
                $mess = $request->request->get('mess');
        

        Then use the data to sent an email with symfony mailer in a POST method in the controller:

        $email = (new Email())
                ->from($from)
                ->replyTo($from)
                ->to('[email protected]')
                ->cc('[email protected]')
                ->bcc('[email protected]')
                ->replyTo($from)
                ->subject('Mensaje desde www.website.com')
                ->text(sprintf('Mensaje enviado: %s, por: %s.', $mess, $name));
        

        Email is sent but variable 'mess' gathered form textarea is always empty, name and email have values.

        Is anything more I have to do for textarea type fielsds?

        Requests are managed by Symfony UX Turbo.

        variable mess should have a value.

        php ajax symfony symfony-forms symfonyux
        Original Q&A
        1

        There are 1 best solutions below

        0
        Miguel Mejia Miguel Mejia On 03 January 2024 at 13:06

        I did track this down to a js file where the mouse click is being captured, the form values posted to an array.

        Modify this to match the fields on the form.

        This solve the problem.

        Related Questions in PHP

        • php Variable name must change in for loop
        • register_shutdown_function is not getting called
        • Query returning zero rows despite entries existing
        • Retrieving *number* pages by page id
        • Automatically closing tags in form input?
        • How to resize images with PHP PARSE SDK
        • how to send email from localhost using codeigniter?
        • Mariadb max Error while sending QUERY packet PID
        • Multiusers login redirect different page in php
        • Imaginary folder when I use "DirectoryIterator" in PHP?
        • CodeIgniter + XDebug: debug only working in the main controller, index() function
        • PHP script timeout when I use sleep()
        • posting javascript populated form to another php page
        • AJAX PHP - Reload div after submit
        • PHP : How can I check Array in array?

        Related Questions in AJAX

        • Ajax jQuery firing multiple time display event for the same result
        • Implement Onfailure in webApi controller
        • AJAX PHP - Reload div after submit
        • ajax load data from mysql
        • Ajax-update only a component attribute, not the whole component nor its children
        • using ajax to get a php database result and then show the result in a button
        • How to prevent browser from executing some JavaScript when person clicks Back button?
        • ajax async: true statement execution order
        • Rails 4.2 jQuery loads only after refresh
        • WebForms GET Json requests (JsonRequestBehavior.AllowGet)
        • Rails - Ajax do not work properly on production server
        • Angular js Button click
        • Make jQuery/AJAX perform instantly on page load
        • jQuery Ajax Uncaught TypeError: Cannot use 'in' operator to search
        • Show success or error messages in Ajax response to Wordpress custom registration form

        Related Questions in SYMFONY

        • Doctrine batch inserting uses 2GB of Ram
        • Adding a callback when reading from an object in Twig
        • Using Twig variable in AngularsJS
        • Twig : Unescape hexadecimal text
        • Symfony : is it better to use a trait or an intermediary class to complete Controller one?
        • Symfony 2 form - date widget and validator
        • Persisting other entities inside preUpdate of Doctrine Entity Listener
        • Symfony2 - Custom annotation loading
        • Display a findAll() result in a form
        • What is the point of the name method in the symfony2 annotation?
        • How to pass a function as a parameter in admin class
        • doctrine/migrations incompatible with symfony 2.2.*
        • Expected argument of type "string or Symfony\Component\Form\FormTypeInterface"
        • Routing problems with AngularJS and Symfony
        • symfony and google identity toolkit

        Related Questions in SYMFONY-FORMS

        • Dynamically setting Form fields in Symfony
        • How to repeat form elements for rows from database
        • Symfony2 AppCache behaviour on HTTP Methods PUT and DELETE
        • Using form helper with PhpEngine as standalone
        • Symfony form theme avoid block output and use custom variables in block
        • Trouble with using entity Field Type field with choice in case of standalone symfony-form component
        • Kunstmaan CMS: Form not getting passed to view
        • Symfony2: Form Collection of entities with one-to-one relationship
        • embedding current user id in a form Symfony 2
        • Expected argument of type "array or (\Traversable and \ArrayAccess) in Symfony collection field type
        • How to Embed a Collection of Forms - one-to-many/many-to-one
        • How do I stop Symfony 2 checkbox from returning null
        • Parsing YAML to check structure
        • Symfony Form with subform
        • Symfony subforms change setter function

        Related Questions in SYMFONYUX

        • impossible to use vue-multiseclect in symfony-ux-vue
        • Symfony UX React with .tsx file not working?
        • symfony ux-live
        • Symfony UX - TomSelect Autocomplete custom js controller problem
        • Reinitialize autocomplete after form submission
        • symfony easyadmin dropzone field
        • Symfony UX chart does not show chart in easyadmin
        • Symfony UX and VueJs - multi-bundle structure
        • Symfony UX Autocomplete - choice_label with KnpLabs Translatable
        • Symfony ux-react: React component does not render when using react_component()
        • Symfony UX Swup, Unknown "stimulus_controller" function
        • ClassNotFoundError in Symfomy 6 project
        • Symfony UX Chart.js just display a blank square
        • How to make an knp paginator pagination with a SearchBar Live component in Symfony?
        • Symfony 6, form textarea not posted after submiting the form

        Trending Questions

        • UIImageView Frame Doesn't Reflect Constraints
        • Is it possible to use adb commands to click on a view by finding its ID?
        • How to create a new web character symbol recognizable by html/javascript?
        • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
        • Heap Gives Page Fault
        • Connect ffmpeg to Visual Studio 2008
        • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
        • How to avoid default initialization of objects in std::vector?
        • second argument of the command line arguments in a format other than char** argv or char* argv[]
        • How to improve efficiency of algorithm which generates next lexicographic permutation?
        • Navigating to the another actvity app getting crash in android
        • How to read the particular message format in android and store in sqlite database?
        • Resetting inventory status after order is cancelled
        • Efficiently compute powers of X in SSE/AVX
        • Insert into an external database using ajax and php : POST 500 (Internal Server Error)

        Popular # Hahtags

        javascript python java c# php android html jquery c++ css ios sql mysql r reactjs

        Popular Questions

        • How do I undo the most recent local commits in Git?
        • How can I remove a specific item from an array in JavaScript?
        • How do I delete a Git branch locally and remotely?
        • Find all files containing a specific text (string) on Linux?
        • How do I revert a Git repository to a previous commit?
        • How do I create an HTML button that acts like a link?
        • How do I check out a remote Git branch?
        • How do I force "git pull" to overwrite local files?
        • How do I list all files of a directory?
        • How to check whether a string contains a substring in JavaScript?
        • How do I redirect to another webpage?
        • How can I iterate over rows in a Pandas DataFrame?
        • How do I convert a String to an int in Java?
        • Does Python have a string 'contains' substring method?
        • How do I check if a string contains a specific word?
        .

        Copyright © 2021 Jogjafile Inc.

        • Disclaimer
        • Privacy
        • TOS
        • Homegardensmart
        • Math
        • Aftereffectstemplates