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

  • Home
  • SEARCH
  • 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 6125287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:13:49+00:00 2026-05-23T16:13:49+00:00

I want to make a simple FORM (not SQLFORM) in web2py with two fields

  • 0

I want to make a simple FORM (not SQLFORM) in web2py with two fields namely ‘name’ and ‘password’.
I have used the following code

form=FORM('Cloned VM Name:',INPUT(_name='name',requires=IS_NOT_EMPTY()),
          'VNC Password:',INPUT(_name='password',_type='password',requires=IS_NOT_EMPTY()),
           INPUT(_type='submit', _value='Clone it!'))

I could generate the form but the fields are not appearing what we expect
it like
enter image description here

Is there a way i can position the fields.

  • 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-23T16:13:49+00:00Added an answer on May 23, 2026 at 4:13 pm

    The FORM and INPUT helpers are just replacements for the HTML <form> and <input> tags, so your code will produce this HTML:

    <form action="" enctype="multipart/form-data" method="post">
    Cloned VM Name:<input name="name" type="text" />
    VNC Password:<input name="password" type="password" />
    <input type="submit" value="Clone it!" />
    </form>
    

    Depending on how you want the form formatted, you could add additional web2py HTML helpers and/or use CSS. For example, if you want each input on a separate line, just put each one into a DIV:

    form=FORM(DIV('Cloned VM Name:',INPUT(_name='name',requires=IS_NOT_EMPTY())),
         DIV('VNC Password:',
             INPUT(_name='password',_type='password',requires=IS_NOT_EMPTY())),
         DIV(INPUT(_type='submit',_value='Clone it!')))
    

    Alternatively, if you want to take advantage of some of web2py’s SQLFORM functionality (such as the formstyle argument to control the formatting) but do not want to base the form on a database table, you can use SQLFORM.factory.

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

Sidebar

Related Questions

i have a simple chat application in flex 3 and i want to make
I'm trying make my first python app. I want make simple email sender form.
I have a pretty simple form with a listbox, a text box, and two
Inside a <form> I want to use multiple Password type fields but.. I want
Well I have a simple problem with Nokogiri. I want to make Nokogiri::HTML::Builder to
I have been trying to make a simple app with 3 fields like this:
i have a form with 2 fields username: password: and a submit button. the
I have a very simple scenario where I want to POST the form using
Basically I want to make simple toggle program (that will be mapped to some
I need information about making installation packages for Linux. I want to make simple

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.