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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:51:34+00:00 2026-06-04T05:51:34+00:00

I am using web2py to write a search engine like app. Is it possible

  • 0

I am using web2py to write a search engine like app. Is it possible to implement two submit button for one form such as google has two buttons “search” and “I am feeling lucky”. Thanks in advance.

  • 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-04T05:51:36+00:00Added an answer on June 4, 2026 at 5:51 am

    Something like this:

    def search():
        form = FORM(INPUT(_type='text', _name='keywords'),
            INPUT(_type='submit', _value='Search'),
            INPUT(_type='submit', _value="I'm feeling lucky", _name='lucky'),
            _method='get')
        if request.vars.keywords:
            if request.vars.lucky:
                [code to return "I'm feeling lucky" results]
            else:
                [code to return regular results]
        return dict(form=form)
    

    Giving a name to the “I’m feeling lucky” submit button causes its value to be submitted with the form, so you can check for its presence among the submitted variables and conditionally return a different response in that case.

    Note, the FORM() helper defaults to using the post method, but because this is a search form, the above uses the get method.

    You could also build the form manually in the view rather than using the FORM() helper.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using web2py and Google App Engine, I create on a model file, a field
I've got an Apache2/web2py server running using the wsgi handler functionality. Within one of
Using Flex 3, I would like to take an image snapshot such as this:
I am building an app using Web2py framework... I don't want to have to
Any pointers, advice on implementing a REST API on App Engine with Python? Using
It looks like using CouchDB with the standard web2py DAL is still a ways
I've been using PyAMF to write a backend for a flex app that will
I am using Web2Py to create a simple app which sends Push notifications through
I've just started using web2py with Google AppEngine for an app of mine. For
I am using the web2py ajax function, like this: In index.html {{=INPUT(_name='total_buy', _onkeyup= ajax('key',['total_buy'],

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.