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 3782414
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:04:46+00:00 2026-05-19T11:04:46+00:00

The form has this hidden field <input type=hidden name=dir_type value=tshirt> url parameters are /dir?type=tshirt

  • 0

The form has this hidden field

<input type="hidden" name="dir_type" value="tshirt">

url parameters are

/dir?type=tshirt
/dir?type=books
/dir?type=posters

and so on.

Now I hard coded value="tshirts" but how do I get parameter for the relevant page?

I found several pages like this dealing with similar topics but I did not understand how this is done.

Thanks for your help.

UPDATE

The answer by systempuntoout works perfectly but I decided to solve the problem without using templates. And for anyone who has a similar question, passing the url parameter to the form like this works well:

<form name="submit_form" action="/directorysubmithandler" method="post" onSubmit="return validate_form()">
title: <input type="text" name="title" size=50><br />
url: <input type="text" name="url" size=50><br />
<input type="hidden" name="dir_type" value="%s")>
<input type="submit" value="submit">
</form>""" % self.request.get("type"))                      
  • 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-05-19T11:04:47+00:00Added an answer on May 19, 2026 at 11:04 am

    a. pass the type value to the view:

    class Directory(webapp.RequestHandler):
        def get(self):
           ....
           merchandise_type = self.request.get("type", "")
           items = Item.all()
           items.filter("type =", merchandise_type)
           path = os.path.join(os.path.dirname(__file__), 'dir_details.html')
           self.response.out.write(template.render(path,{'type':merchandise_type}))
    

    b. add the type value to the hidden field:

    <input type="hidden" name="dir_type" value="{{ type }}">
    

    c. get the dir_type value in your post handler:

    class DirectorySubmitHandler(webapp.RequestHandler):
        def post(self):
            user = users.get_current_user()
            merchandise_type = self.request.get("dir_type", "")
            dir_type = merchandise_type
            if user:
                item = Item()
                item.title = self.request.get("title")
                item.url = self.request.get("url")
                item.type = self.request.get("dir_type")
                item.user_who_liked_this_item = user
                item.put()
                self.redirect("/dir?type=%s" %
    self.request.get("dir_type"))
            else:
                self.redirect(users.create_login_url(self.request.uri)) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to set the value of a hidden field in a form
I have this table where I can generate dynamic rows (which has input <type=text
Everyone has this huge massively parallelized supercomputer on their desktop in the form of
How do you detect which form input has focus using JavaScript or jQuery? From
I have a form with a bunch of checkboxes, and a hidden field that
Currently I have an HTML form with a hidden field right before a text
I have this problem: My web application has a form where the users can
Is there an event I can use to tell if a child form has
I have a form that has multiple fields, and for testing purposes is there
Within my InfoPath form (which has to be loaded within a SharePoint Portal by

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.