不能用JAVASCRIPT自己的ALERT等等弹出对话框。
要自己用页面做
要实现功能如下:
1。删除 确认 点删除后弹出网页窗口 点ESC或关闭窗口 停止提交返回,点OK提交。
2。点击提交 如果前面文本框有没选的 自动弹出网页 网页上有提示说有必填的没添 并有一个OK按钮 点OK或关闭窗口 停止提交。
怎么弹出网页我知道 但是不知道弹出网页里面的JAVASCRIPT怎么写。
希望高手解答
------解决方案--------------------
1.主页面
- HTML code
<form name="form1" action="">
<input type="text" name="username">
<input type="button" name="submitForm" value="提交" onclick="submitForm1();">
</form>
<script>
function submitForm1(){
var result=window.showModalDialog("myconfirm.html",
2,"dialogWidth:240px;dialogHeight:120px;status:no;");
if(result==1){
check(document.getElementsByName("form1")[0]);
}
}
function check(frm){
var username=document.getElementsByName("username")[0];
var result;
if(username.value==""){
result=window.showModalDialog("myconfirm.html",
new Array(1,"请输入用户名"),"dialogWidth:240px;dialogHeight:120px;status:no;");
return;
}
frm.submit();
}
</script>