Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7872675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:16:35+00:00 2026-06-03T02:16:35+00:00

This code work fine except the comment : It’s not insert in the body

  • 0

This code work fine except the comment: It’s not insert in the body of message.

<div class="modal" id="feedback">
    <form action="/feedback" method="POST">
        <div class="modal-body">
            <textarea class="input-xxlarge" name="comment" rows="3"></textarea>
        </div>
        <div class="modal-footer">
            <a class="btn" type="submit" href="/feedback">Send</a>
        </div>
    </form>
</div>
class SendFeedback(webapp2.RequestHandler):
def get(self):
    user = users.get_current_user()
    comment = self.request.get('comment')
    message = mail.EmailMessage()
    message.sender = user
    message.to = 'foo@bar.com'
    message.subject = "Feedback from %s" % user
    message.body = """
            Feedback:
            %s
            """ % comment
    message.send()
    self.redirect(self.request.headers['referer'])

Depends on ENCTYPE="multipart/form-data" or %s or what?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:16:36+00:00Added an answer on June 3, 2026 at 2:16 am

    the forms method is POST while your Handler implemented a GET method.

    edit:

    change def get(self) to def post(self)

    class SendFeedback(webapp2.RequestHandler):
        def post(self):
            ...
    

    and the post data is:

    data    = self.request.POST
    comment = data.get('comment')
    

    edit2

    this code works:

    form = """
    <div class="modal fade" id="feedback">
        <form action="/feedback" method="POST">
            <div class="modal-header"><h3>Aiutaci a migliorare</h3></div>
            <div class="modal-body">
                <p>un piacere sapere cosa cambiereste di Metrico</p>
                    <textarea class="input-xxlarge" name="comment" rows="3"></textarea>
            </div>
            <div class="modal-footer"><input class="btn btn-inverse" type="submit"/></div>
        </form>
    </div>
    """
    
    class FormTest(webapp2.RequestHandler):
    
        def get(self):
            self.response.out.write(form)
    
        def post(self):
            data = self.request.POST
            comment = data.get('comment')
            body = """
    Feedback:
    %s
    """ % comment
            self.response.out.write(body)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

...at least to me. This code used to work fine. I'm pretty sure nothing
I have this below code and it work fine header (content-type: text/xml); $xml =
this code in my plugin used to work just fine: jQuery('#embedded_obj', context).get(0).getVersion(); and the
How can I make this code work? class Meta @array = [:a,:b] def self.method_missing(name,
This code works fine for absolutely every mail client except Mail for OSX, which
I've just started using eclim to code java. Everything seems to work fine except
Does this code work across all standard compliant C++ compilers (it works with g++)?
Why doesn't this code work in IE6 or IE7? $('a').click( function() { var urlIsExternal
Why won't this code work correctly? I am sorry I couldn't understand how to
Is there a way to make this code work? LogonControl.java @Audit(AuditType.LOGON) public void login(String

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.