简体   繁体   English

使用JSON创建dForms时出现对齐问题

[英]Alignment issue while creating dForms using json

I am creating a web page using dForm, for that used json file is as follows, 我正在使用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"
                },
            }
        ]

and I am geting the output. 而我得到的输出。 But fields are coming under captions.I want each pair in single line. 但是字段受到标题的限制。我希望每对都在一行中。 How can I make that? 我该怎么做?

the result I got as follows, 我得到的结果如下

在此处输入图片说明

but my need is, 但我需要的是

在此处输入图片说明

How can I do this? 我怎样才能做到这一点?

solved the issues by using , 通过使用解决了问题,

"type": "span",
"style":"display:inline-block"

example for getting on same line, 在同一条线上的例子

{   
                "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"
                    }
                }
                }]
            }

And also using of formio is another option. 另外,使用formio是另一种选择。 https://www.form.io/ Good documentation with more options. https://www.form.io/具有更多选择的优质文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM