English
form.submit.before
About 118 wordsLess than 1 minute
2025-09-22
Executed before clicking Submit or before the submission logic is triggered.
Parameters
| Parameter | Description | Type |
|---|---|---|
| object_data | Master-object data to be submitted | Object |
| details | Detail-object data to be submitted | Object |
| related_data_list | Related-object data to be submitted | Object |
Return Value
| Parameter | Description | Type |
|---|---|---|
| consumed | true stops subsequent logic; false continues the submission flow with the input data | Boolean |
Code Example
Intercept the submission flow:
{
event: "form.submit.before",
functional: function (pluginExecResult, options) {
return new Promise(resolve => {
wx.showModal({
title: "Plugin Intercepts Submission",
content: "Submit?",
showCancel: true,
success(rst) {
if (rst.confirm) {
options.object_data.name="Plugin Modified Data Test"
resolve()
}else{
resolve({consumed:true})
}
}
})
})
}
}Notes
- Calling
dataUpdaterto update master/detail data in this event is not suitable.
