Introduction: What Are Web Forms in Frappe?
In Frappe Framework v15, Web Forms provide a simple, secure way to collect data from website visitors without exposing the Desk interface. They allow users to submit information directly into a DocType using a public or authenticated web page.
Web Forms are commonly used for contact requests, support tickets, registrations, and feedback forms.
What Is a Web Form?
Answer:
A Web Form is a configurable website interface that allows users to create or update DocType records through a browser without logging into the Desk.
Key characteristics:
- Works on top of a DocType
- Can be public or login-restricted
- Enforces DocType permissions
- Requires no custom frontend code
How Web Forms Work in Frappe v15
The Web Form workflow follows this sequence:
- User opens a web form URL
- Fields are rendered from DocType metadata
- Input is validated server-side
- A document is created or updated
- Permission rules are enforced
This ensures secure, controlled data entry from external users.
Creating a Web Form in Frappe
Step-by-Step
- Go to Web Form
- Click New
- Select the target DocType
- Choose fields to display
- Configure permissions and behavior
- Save and publish
Once published, the form is instantly accessible via its route.
Supported Field Types in Web Forms
Web Forms support most standard field types, including:
- Data
- Select
- Date
- Attach
- Text Editor
- Link
- Check
Unsupported or restricted fields are automatically excluded.
Public vs Login-Required Web Forms
Public Web Forms
- Accessible without authentication
- Used for contact forms or inquiries
- Subject to permission checks
Login-Required Web Forms
- Require user login
- Used in customer or member portals
- Respect role-based access
This distinction enables flexible access control.
Web Form Permissions and Security
Web Forms do not bypass permissions.
Security is enforced using:
- DocType permissions
- Role checks
- Field-level visibility
- User ownership rules
If a user cannot create a document in Desk, they cannot submit it via a Web Form.
Updating Existing Records Using Web Forms
Web Forms can also edit existing documents.
This is enabled by:
- Linking the form to a document
- Ensuring edit permission exists
- Using URL parameters
This is useful for profile updates or ticket follow-ups.
Redirects and Success Messages
After submission, Web Forms can:
- Show a success message
- Redirect to another page
- Display the created document
These behaviors are configurable in the Web Form settings.
File Uploads in Web Forms
Web Forms support file uploads using Attach fields.
Uploaded files:
- Follow standard file permissions
- Are linked to the created document
- Are stored securely in the system
This is useful for resumes, screenshots, or documents.
Best Practices for Web Forms
- Expose only required fields
- Avoid sensitive internal fields
- Validate inputs at DocType level
- Use login-required forms for sensitive data
- Combine with Portal Roles when needed
Common Use Cases
- Contact Us forms
- Support ticket submission
- Customer onboarding
- Event registrations
- Feedback collection
Web Forms eliminate the need for custom frontend development in these scenarios.
Troubleshooting Web Form Issues
Form not visible
- Check Published flag
- Verify route configuration
Submission fails
- Check DocType permissions
- Validate mandatory fields
Fields missing
- Confirm field visibility settings
- Check field type compatibility
Technical Scope & Compatibility
- Framework: Frappe Framework v15
- Modules: Website
- Applies to: ERPNext and custom Frappe apps
- Not applicable: Desk forms, Reports, Print Formats
Industry Relevance
- SaaS onboarding
- ERP portals
- Customer support systems
- Membership platforms
- Lead capture websites
Cross-References
Official Web Forms Documentation
https://docs.frappe.io/framework/user/en/guides/portal-development/web-forms
Portal Roles
https://docs.frappe.io/framework/user/en/guides/portal-development/portal-roles
Frappe v15 Source Code
https://github.com/frappe/frappe/tree/version-15
Conclusion
Web Forms in Frappe Framework v15 offer a powerful, secure way to collect and manage external data without custom frontend development. By leveraging existing DocType permissions and validation, Web Forms ensure data integrity while keeping implementation simple and maintainable.
When used correctly, Web Forms become a foundational tool for building modern, user-friendly portals in Frappe.