function add()
{
var value=window.showModalDialog("./Subject/subjectadd.jsp",null,"dialogwidth:600px;dialogheight:400px");
}<input type="button" value="新增" style="width:50px; height:40px;" onclick="add()"/>
我点击新增按钮,然后弹出一个对话框。我在刚刚弹出来的对话框里面,写完表单的数据后。点击保存按钮,想自动关闭当前对话框,并且返回到开始的父对话框。请问怎么写? 麻烦各位了,真不好意思,我实在写不出来了。不是我没有想。<input type="submit" name="save1" value="保 存" style="width:100px; height:35px;"/>小弟三叩首拜上。
{
var value=window.showModalDialog("./Subject/subjectadd.jsp",null,"dialogwidth:600px;dialogheight:400px");
}<input type="button" value="新增" style="width:50px; height:40px;" onclick="add()"/>
我点击新增按钮,然后弹出一个对话框。我在刚刚弹出来的对话框里面,写完表单的数据后。点击保存按钮,想自动关闭当前对话框,并且返回到开始的父对话框。请问怎么写? 麻烦各位了,真不好意思,我实在写不出来了。不是我没有想。<input type="submit" name="save1" value="保 存" style="width:100px; height:35px;"/>小弟三叩首拜上。
window.returnValue= "你要返回的值";
window.close();
}
<input type="submit" name="save1" value="保 存" style="width:100px; height:35px;" onclick="close()"/>function close(){
window.close();
location.href="父对话框.html";
}
<input type="text" name="username" value=""/>
<input type="submit" name="save1" value="保 存" style="width:100px; height:35px;" onclick="close()"/>
</form>
<script>
function close(){
var form = document.form[0];
var input_box = form.getElementsByName('username');
window.returnValue = input_box.value;
window.close();
window.event.returnValue = false;
}
</script>