0

I created one landing page, when customers fill all the details it should display in the custom module grid in magento admin panel,

how can i implement, <form action="">, what to put in action part.

1

1 Answer 1

1

feedback_customer_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   layout="2columns-right" 
   xsi:noNamespaceSchemaLocation=
   "../../../../../../../lib/internal/Magento/
   Framework/View/Layout/etc/page_configuration.xsd">
<head>
    <script src="https://www.google.com/recaptcha/api.js" src_type="url" />
</head>
  <body>
    <referenceBlock name="content">
        <block  class="Magento\Framework\View\Element\Template" template="Vendor_Module::feedback_form.phtml" ifconfig="FeedBack/FeedBackgroup/show_feedback_module"/>
    </referenceBlock>
  </body>
</page>

feedback_form.phtml

<h1>FeedBack Form</h1>
<form class="form" id="feedback-form" method="post" action="<?php echo $block->getBaseUrl()?>feedback/index/save" data-mage-init='{"validation":{}}'>
    <div class="form-group">
        <label class="control-label col-sm-2" for="first_name">First Name:</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="first_name" placeholder="First Name" name="first_name" data-validate='{"required": true}'>
        </div>
    </div>
    <br/>
    <div class="form-group">
        <label class="control-label col-sm-2" for="last_name">Last Name:</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="last_name" placeholder="Last Name" name="last_name" data-validate='{"required": true}'>
        </div>
    </div>
    <br/>
    <div class="form-group">
        <label class="control-label col-sm-2" for="email">Email:</label>
        <div class="col-sm-10">
            <input type="email" class="form-control" id="email" placeholder="Email" name="email" data-validate='{"required": true, "validate-email":true}'>
        </div>
    </div>
    <br/>
    <br/><br/>
    <div class="form-group">
        <label class="control-label col-sm-2" for="message">Message:</label>
        <div class="col-sm-10">
            <textarea class="form-control" id="message" placeholder="Message" name="message" data-validate='{"required": true}'></textarea>
        </div>
    </div>
    <br/>
    <div class="form-group">
        <div class="g-recaptcha" name="recaptcha" id="recaptcha" data-sitekey="6LeMp8sUAAAAALt7DEdC5RSX9UMUvIpOQMeCOwhb"></div>
    </div>
    <br/>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" name="feedback_submit" id="feedback_submit" class="btn btn-default">Submit</button>
        </div>
    </div>
</form>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.