我需要使用 JSON 创建一个动态表单。我已经解析了 JSON,但我不知道如何动态创建表单。请建议一些代码或教程。
[
{
"cssClass": "head"
},
{
"cssClass": "input_text",
"values": "Text Field",
"fieldsize": "small",
"required": "undefined",
"prevalue": "This is text field",
"autocaps": "none",
"fieldesc": "text field description"
},
{
"cssClass": "number",
"values": "Number ",
"fieldsize": "small",
"required": "required",
"prevalue": "This is Number Field",
"autocaps": "capitalize",
"fieldesc": "number field description"
},
{
"cssClass": "email",
"values": "Email",
"fieldsize": "small",
"required": "required",
"prevalue": "This is email field",
"autocaps": "none",
"fieldesc": "email field description"
},
{
"cssClass": "password",
"values": "Password",
"fieldsize": "small",
"required": "required",
"prevalue": "password",
"autocaps": "none",
"fieldesc": "password field description"
},
{
"cssClass": "date",
"values": "Date",
"fieldsize": "medium",
"required": "required",
"prevalue": "datefield",
"autocaps": "uppercase",
"fieldesc": "date field description"
},
{
"cssClass": "time",
"values": "Time",
"fieldsize": "small",
"required": "undefined",
"prevalue": "time field",
"autocaps": "uppercase",
"fieldesc": "time field description"
}
]