Merge pull request #34379 from UmakanthKaspa/feat-webform-placeholder-support

feat: add placeholder and max_length support to webform fields
This commit is contained in:
Ejaaz Khan 2025-10-16 15:05:03 +05:30 committed by GitHub
commit 0344119d81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 3 deletions

View file

@ -118,6 +118,8 @@ frappe.ui.form.on("Web Form", {
read_only: df.read_only,
precision: df.precision,
depends_on: df.depends_on,
placeholder: df.placeholder,
max_length: df.length,
description: df.description,
mandatory_depends_on: df.mandatory_depends_on,
read_only_depends_on: df.read_only_depends_on,
@ -338,8 +340,10 @@ frappe.ui.form.on("Web Form Field", {
doc.default = df.default;
doc.read_only = df.read_only;
doc.depends_on = df.depends_on;
doc.placeholder = df.placeholder;
doc.description = df.description;
doc.mandatory_depends_on = df.mandatory_depends_on;
doc.max_length = df.length;
doc.read_only_depends_on = df.read_only_depends_on;
frm.refresh_field("web_form_fields");

View file

@ -26,7 +26,8 @@
"section_break_6",
"description",
"column_break_8",
"default"
"default",
"placeholder"
],
"fields": [
{
@ -152,17 +153,23 @@
"fieldtype": "Select",
"label": "Precision",
"options": "\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9"
},
{
"fieldname": "placeholder",
"fieldtype": "Data",
"label": "Placeholder"
}
],
"istable": 1,
"links": [],
"modified": "2024-04-15 16:11:58.469820",
"modified": "2025-10-13 16:53:27.147994",
"modified_by": "Administrator",
"module": "Website",
"name": "Web Form Field",
"owner": "Administrator",
"permissions": [],
"row_format": "Dynamic",
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
}

View file

@ -56,6 +56,7 @@ class WebFormField(Document):
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
placeholder: DF.Data | None
precision: DF.Literal["", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
read_only: DF.Check
read_only_depends_on: DF.Code | None