按钮不是在使用mvc中的javascript单击另一个按钮时不可见 [英] button is not geting invisible on anoother button click using javascript in mvc
本文介绍了按钮不是在使用mvc中的javascript单击另一个按钮时不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在使用javascipt点击amother按钮时看不见,但在调试需要对象时收到错误
//代码
I want to do buton invisible on amother button click using javascipt but getting error while debugging"object required"
//code
<input type="submit" id="Submit" value="Submit" onclick="OpenWindow()" />
<input type="submit" id="Update" value="Update" style="visibility:hidden" />
<input type="submit" id="Edit" value="Edit" style="visibility:hidden" />
// javascript
//javascript
function OpenWindow() {
debugger
//alert("Student form window");
//document.getElementById("Confirm").style.visibility = true;
//document.getElementById("Update").style.visibility = true;
// document.getElementById("Submit").style.visibility = false;
var con = document.getElementById('<%=Confirm.ClientID%>');
var update = document.getElementById('<%=Update.ClientID%');
var edit = document.getElementById('<%=Edit.ClientID%');
con.style.display = "none";
update.style.display = "block";
edit.style.display = "block";
var dialog = $("#window-prototype").kendoWindow({
width: "500px",
height: "280px",
modal: false,
visible: true,
resizable: true,
actions: ["Custom", "Minimize", "Maximize", "Close"],
title: "Student Form"
}).show().data("kendoWindow").open().center();
推荐答案
( #window-prototype)。kendoWindow({
width: 500px,
height: 280px,
模态: false ,
可见: true ,
可调整大小: true ,
操作:[ 自定义 , 最小化, 最大化, 关闭],
title: 学生表格
})。show()。data( kendoWindow)。打开()。centter();
("#window-prototype").kendoWindow({ width: "500px", height: "280px", modal: false, visible: true, resizable: true, actions: ["Custom", "Minimize", "Maximize", "Close"], title: "Student Form" }).show().data("kendoWindow").open().center();
使用mvc时不需要使用'ClientID'。
试试这个
when using mvc it does not require to use 'ClientID'.
try this
var con=document.getElementById("#Submit");
这篇关于按钮不是在使用mvc中的javascript单击另一个按钮时不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文