温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

表单 提交前显示 确认窗口

发布时间:2020-07-08 02:04:21 来源:网络 阅读:3053 作者:yubochinese 栏目:web开发

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link class="include" rel="stylesheet" type="text/css" href="http://static.naughtycolt.com/css/3guo/gm_ban.css" />

<script type="text/javascript" src="http://static.naughtycolt.com/js/jquery.validate.min.js"></script>

<!-- 系统公告发布删除查询页面-->

<link class="include" rel="stylesheet" type="text/css" href="http://static.naughtycolt.com/css/3guo/gm_query.css" />


<div  class="row">

<div  id = "gm_query_title">系统公告</div>

<div   id = "gm_query">

<div class="col-md-6 col-md-offset-3">

<form class="form-inline" role="form" action="" method="post" id="send_form" >

{% csrf_token %}

<input type="text" class="form-control" name="radio" id="radio" placeholder="系统公告内容" ><select class="form-control" name = "server_name" id="server_name">

{% if server_dict %}

{% for k in server_dict %}

<option>` k`</option>

{% endfor %}

{% endif %}

</select>

</form>

<!--按钮写在form外防止 form自动提交   提交时  submit() id 要写 对应表单的id -->

<button id="send">发布</button><button id="query">查询</button>

</div>

<div  id = "gm_query_list">

<table class="table table-condensed">

{% if radios %}

   <th class="success" >ID</th>

<th class="warning" >`show_server_name`</th>

{% for r in radios %}

<tr>

<td class="success" >` forloop`.`counter `</td>

<td class="warning" >` r `</td>

</tr>

{% endfor %}

{% endif %}

</table>

</div>

<!--弹出确认窗口-->

<div id="radio_confirm" title="系统公告">  

<table class="table table-condensed">


<tr>

<td  class="info" >服务器名</td>

<td  class="danger">操作</td>

<td  class="warning">内容</td>


</tr>

<tr>

<td  id= "td_server" class="success" ></td>

<td  id="td_op" class="danger"></td>      

<td  id="td_content" class="warning"></td>

</tr>                

</table>

</div>

</div>




<script>

$( "#send,#query" ).button({ icons: { primary: "ui-icon-search"} });

$( "#radio_confirm" ).dialog({

 autoOpen: false,

     show: {

       effect: "blind",

       duration: 1000

     },

     hide: {

       effect: "explode",

       duration: 1000

     },

    // height:200,

 modal: true,

 buttons: {

      "确定": function() {

$("#radio_confirm").dialog("close");

$('#send_form').submit();

          },

       "取消": function() {

$("#radio_confirm").dialog("close");

$("#send_form")[0].reset();

 }

 }

});

$( "#send" ).click(function() {

 $("#send_form").validate({

rules: {

radio: "required"

},

messages: {

radio: "公告内容不能为空"

}

});

 $("#td_op").html("发布");

 $("#td_server").html($("#server_name").val());

 $("#td_content").html($("#radio").val());

 $("#radio_confirm").dialog( "open" );

});

$( "#query" ).click(function() {

$("#send_form").submit();

});

</script>  


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI