使用 json 创建 dForm 时出现对齐问题
Alignment issue while creating dForms using json
我正在使用 dForm 创建一个网页,所使用的 json 文件如下,
"action":"index.html",
"method":"get",
"html":[
{
"type":"fieldset",
"caption":"New Issue",
"html":[
{
{
"name":"subject",
"class": "form-control",
"id":"subject",
"caption":"Subject",
"type":"text"
},
{
"name":"description",
"id":"description",
"class": "form-control",
"caption":"Description",
"type":"textarea"
},
}
]
我正在获取输出。但是 captions.I 下的字段希望每一对都在一行中。我该怎么做?
我得到的结果如下,
但我的需要是,
我该怎么做?
使用 ,
解决了问题
"type": "span",
"style":"display:inline-block"
上线示例,
{
"type": "span",
"style":"display:inline-block",
"html": [{
"name": "subject",
"id": "subject",
"type": "text",
"class": "form-control",
"value": "",
"data-validation-key": 0,
"data-tabs-type": "sensors",
"readOnly": false,
"validate": {
"required": false,
"messages": {
"remote": "Invalid Format"
}
}
}]
},{
"type": "span",
"style":"display:inline-block",
"html": [{
"name": "description",
"id": "description",
"type": "text",
"class": "form-control",
"value": "",
"data-validation-key": 0,
"data-tabs-type": "sensors",
"readOnly": false,
"validate": {
"required": false,
"messages": {
"remote": "Invalid Format"
}
}
}]
}
使用 formio 也是另一种选择。 https://www.form.io/ 不错的文档,有更多选项。
我正在使用 dForm 创建一个网页,所使用的 json 文件如下,
"action":"index.html",
"method":"get",
"html":[
{
"type":"fieldset",
"caption":"New Issue",
"html":[
{
{
"name":"subject",
"class": "form-control",
"id":"subject",
"caption":"Subject",
"type":"text"
},
{
"name":"description",
"id":"description",
"class": "form-control",
"caption":"Description",
"type":"textarea"
},
}
]
我正在获取输出。但是 captions.I 下的字段希望每一对都在一行中。我该怎么做?
我得到的结果如下,
但我的需要是,
我该怎么做?
使用 ,
解决了问题"type": "span",
"style":"display:inline-block"
上线示例,
{
"type": "span",
"style":"display:inline-block",
"html": [{
"name": "subject",
"id": "subject",
"type": "text",
"class": "form-control",
"value": "",
"data-validation-key": 0,
"data-tabs-type": "sensors",
"readOnly": false,
"validate": {
"required": false,
"messages": {
"remote": "Invalid Format"
}
}
}]
},{
"type": "span",
"style":"display:inline-block",
"html": [{
"name": "description",
"id": "description",
"type": "text",
"class": "form-control",
"value": "",
"data-validation-key": 0,
"data-tabs-type": "sensors",
"readOnly": false,
"validate": {
"required": false,
"messages": {
"remote": "Invalid Format"
}
}
}]
}
使用 formio 也是另一种选择。 https://www.form.io/ 不错的文档,有更多选项。