我正在寻找一种将表单输出自动化为 json 格式而不是 html 的方法。我正在使用 JQuery dform http://plugins.jquery.com/project/dform创建动态表单。
样本输出:
{ "type" : "p", "html" : "你必须登录" }, { "name" : "username", "id" : "txt-username", "caption" : "Username", "type" :“文本”,“占位符”:“例如 user@example.com”},{“名称”:“密码”,“标题”:“密码”,“类型”:“密码”},{“类型”: “提交”,“价值”:“登录”}
请帮忙