用js写了一个ligerForm,然后想在里边加一个按钮,应该怎么加 javascriptjsligerUI 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就是最后一行代码:{ display: "按钮", name: "bbb", newline: true, type: "button"}我想要的是写成一个按钮; var btn= { display: "按钮", name: "bbb", newline: true, type: "button"};mainform.ligerForm.fields.push(btn);这样试试? 多谢回复!虽然我试过不起作用不过我迂回了一下,先给写一个文本框{ name: "bbb", newline: true, type: "text"}然后在后面再把这个文本框删掉,换一个button上去var node=document.getElementById("cc").parentNode.parentNode; var parentnode=node.parentNode; parentnode.removeChild(node); var newNode=document.createElement("input"); newNode.type="button"; newNode.value="here"; parentnode.appendChild(newNode); 恶、、 我写的有问题、、 sorry了 把数组的方法用到对象上了 、、 这样写好像生不成input的id属性 buttons:[{ text: '按钮', onclick: function () { } }] fields块下面加 buttons: [ { text: '确定', width: 60, click: f_save }, { text: '取消', width: 60, click: f_close } ] 怎样利用jquery为radio的value赋值 急,请问javascript的this对象问题? 尚未声明变量"dlgHelper" window.showModalDialog的status网址怎样改成其他文字? 请教 时间格式问题 firefox下如何用canvas画带箭头直线 100分求解决问题 JavaScript字符型的问题 怎么样让一个单选按钮可以控制两个下拉列表框的显示属性。 菜鸟问题? 怎么上传头像 如图 求js联动查询完整代码
mainform.ligerForm.fields.push(btn);
这样试试?
不过我迂回了一下,先给写一个文本框
{ name: "bbb", newline: true, type: "text"}
然后在后面再把这个文本框删掉,换一个button上去
var node=document.getElementById("cc").parentNode.parentNode;
var parentnode=node.parentNode;
parentnode.removeChild(node); var newNode=document.createElement("input");
newNode.type="button";
newNode.value="here";
parentnode.appendChild(newNode);
[
{ text: '按钮', onclick: function () { } }
]
buttons: [
{ text: '确定', width: 60, click: f_save },
{ text: '取消', width: 60, click: f_close }
]