Introduction
Web2py is an open-source python-based web application development framework. It is used for creating dynamic websites with less coding complexities using the python programming language. It offers a faster, more straightforward, and less verbose way of developing web applications, making it a good choice for beginners.
This article will discuss custom forms, CSS conventions, and hide errors in web2py.

Custom Forms in web2py
Web2py is preferred over other web frameworks because of the available format/blueprint that you can use directly in your applications without writing much of the code yourself. Custom forms are one such feature of web2py. You can easily create new custom forms in web2py according to your requirements.

Suppose a form is being created using SQLFORM, SQLFORM.factory, or CRUD(Create, Retrieve, Update, and Delete operations). In that case, you can integrate it with a view in several ways providing you with multiple possibilities and scope for customization.
For instance, suppose you have the following model with a defined upload action:
db.define_table('image',
Field('name', requires=IS_NOT_EMPTY()),
Field('source', 'upload'))
def image_upload():
return dict(form=SQLFORM(db.image).process())
Then the easiest way to integrate this model with a view can be by using the following command:
{{=form}}
By default, the resultant form created by this code would be in tabular format. You can also break the form into its components using widgets to give your new custom form a different layout. Following is an example of how you can break it into its components:
{{=form.custom.begin}}
Image Name: <div>{{=form.custom.widget.name}}</div>
File: <div>{{=form.custom.widget.source}}</div>
{{=form.custom.submit}}
{{=form.custom.end}}
This helps in building new custom forms in different formats. Also, if any error occurs in any field, it can be specified below the widget/component in which the error occurred.
The form now created would look something like the one shown below:

You can also get the above results without using a custom form with the help of formstyle keyword. Following is an example of how you can do so:
SQLFORM(..., formstyle='table2cols')
If you want to create a similar form with CRUD operations, then you can specify the formstyle keyword as follows:
crud.settings.formstyle='table2cols'







