反应 json 模式表单不发送空值键
react json schema form not sending empty value key
我正在使用 React json 模式表单来创建表单。我正在尝试提交表格。当我发送空值时。密钥从数据中删除。例如
在一个表单中,我有两个字段名称和地址。
输入
姓名="abc"
地址=""
输出
{
name:abc
}
需要输出
{
name:abc,
地址:
}
您可以使用默认值。
尝试
{
"title": "A registration form",
"description": "A simple form example.",
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "name",
"default": ""
},
"address": {
"type": "string",
"title": "address",
"default": ""
}
}
}
我正在使用 React json 模式表单来创建表单。我正在尝试提交表格。当我发送空值时。密钥从数据中删除。例如 在一个表单中,我有两个字段名称和地址。 输入 姓名="abc" 地址=""
输出 { name:abc }
需要输出 { name:abc, 地址: }
您可以使用默认值。 尝试
{
"title": "A registration form",
"description": "A simple form example.",
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "name",
"default": ""
},
"address": {
"type": "string",
"title": "address",
"default": ""
}
}
}