javascript 更具button 事件找到当前单元格中的控件并动态赋随机ID
2010-12-07 11:14
357 查看
//用当前时间取随机数
function getNum() {
var now = new Date();
var number = now.getMilliseconds();
var num = now.getFullYear().toString() + now.getMonth().toString() + now.getDay().toString() + now.getHours().toString() + now.getMinutes().toString() + now.getSeconds().toString() + now.getMilliseconds().toString();
return num;
}
function OpenWin(url, e) {
var selectedTr = null;
selectedTr = e.parentNode;
var txtname = "";
var txtid = "";
if (selectedTr != null) {
var str = selectedTr;
var inputs = str.getElementsByTagName("input");
for (var j = 0; j < inputs.length; j++) {
input = inputs[j];
if (input.type == "hidden") {
txtid = getNum();
input.id = txtid;
}
}
txtname = getNum() + "i";
var areatxt = str.getElementsByTagName("textarea");
areatxt[0].id = txtname;
}
var str = "&txtName=" + txtname + "&txtId=" + txtid;
var newwindow = window.open(url + str, null, "toolbar=no,scrollbars=yes,menubar=no, location=no, directories=no,width=680,height=550,top=300,left=300");
}
function getNum() {
var now = new Date();
var number = now.getMilliseconds();
var num = now.getFullYear().toString() + now.getMonth().toString() + now.getDay().toString() + now.getHours().toString() + now.getMinutes().toString() + now.getSeconds().toString() + now.getMilliseconds().toString();
return num;
}
function OpenWin(url, e) {
var selectedTr = null;
selectedTr = e.parentNode;
var txtname = "";
var txtid = "";
if (selectedTr != null) {
var str = selectedTr;
var inputs = str.getElementsByTagName("input");
for (var j = 0; j < inputs.length; j++) {
input = inputs[j];
if (input.type == "hidden") {
txtid = getNum();
input.id = txtid;
}
}
txtname = getNum() + "i";
var areatxt = str.getElementsByTagName("textarea");
areatxt[0].id = txtname;
}
var str = "&txtName=" + txtname + "&txtId=" + txtid;
var newwindow = window.open(url + str, null, "toolbar=no,scrollbars=yes,menubar=no, location=no, directories=no,width=680,height=550,top=300,left=300");
}
相关文章推荐
- ASP.NET2.0中的GRIDVIEW控件在使用TemplateField中的LinkButton时如何在RowCommand事件中找到当前行index的方法
- 用JavaScript获取Gridview中某个触发事件控件的ID
- 使用javascript绑定键盘enter事件到asp.net的button控件 .
- ASP.NET2.0中的GRIDVIEW控件在使用TemplateField中的LinkButton时如何在RowCommand事件中找到当前行index的方法
- 动态生成服务器控件(Button)并使用其click事件
- asp.net运行时,动态添加Button(或其它控件),并处理相应的事件
- asp.net C#动态添加创建生成button按钮控件没有触发执行响应click绑定事件处理
- javascript获取当前点击事件的ID属性值,IE已验证通过
- 怎么在button事件中找到gridview每行的控件?
- Javascript 阻止javascript事件冒泡,获取控件ID值
- 动态添加 button 控件及事件
- JQ获取当前触发事件控件ID
- EasyUI - datagrid中单元格里编辑控件的单击事件如何获取当前行的index
- Javascript 阻止javascript事件冒泡,获取控件ID值
- ASP.NET2.0中的GRIDVIEW控件在使用TemplateField中的LinkButton时如何在RowCommand事件中找到当前行index的方法
- 动态添加 button 控件及事件
- QT 进行动态绑定信号槽时,如何正确找到当前操作的控件?
- Javascript学习日记-阻止javascript事件冒泡,获取控件ID值
- 前台动态创建控件设置ID,事件等实例
- Jquery 侦听键盘事件并获取当前焦点控件ID