我没有任何想法,为什么弹出窗口不会采取2个参数(id_get_post_status2 and id_popup_title2)
。
这是我的代码:
$(document).ready(function(){
$("#popup5").hide();
PopUpHide5();
});
function PopUpShow5(main_id, id, description, data_date, end_date, priority, status, title){
$("#popup5").show();
$(document).keyup(function(ev){
if(ev.keyCode == 27)
window.location = '/';
});
document.getElementById("id_get_post_pk2").value = main_id;
document.getElementById("id_get_post_id2").value = id;
document.getElementById("id_get_post_description2").value = description;
document.getElementById("id_get_post_start_date2").value = data_date;
document.getElementById("id_get_post_end_date2").value = end_date;
document.getElementById("id_get_post_priority2").value = priority;
document.getElementById("id_get_post_status2").value = status;
document.getElementById("id_popup_title2").innerHTML = popup_title;
}
function PopUpHide5(){
$("#popup5").hide();
}
HTML弹出窗口:
<div class="b-popup" id="popup5" >
<div class="b-popup-content">
<div style="width:100%; height:10%;">
<center><b><font color=#000000 size="5" "Lucida Sans Unicode", "Lucida Grande", sans-serif><p id="id_popup_title2"></p></font></b></center>
</div>
<form action="" method="post" >{% csrf_token %}
<font color=#000000 size="3">
<input id="id_get_post_pk2" value="" type="hidden" maxlength="9999" name="get_post_pk" type="text">
<input id="id_get_post_id2" type="hidden" name="get_post_id" type="text" >
<input id="id_post_request2" value="3" type="hidden" maxlength="1" name="post_request" type="text">
<input id="id_get_post_status2" value="" type="hidden" name="status_post" type="text" >
<div style="width:100%; height:55%;">
<label for="id_description_post" style=" display:table; margin-top:0px; padding-left:13px;">Description :<br></label><textarea id="id_get_post_description2" maxlength="9999" name="description_post" style="resize:none; font-size: 12pt; width:100%; height:90%;" autofocus onkeyup="enableField(this.form,this.value)" type="text"></textarea><br>
</div>
<div style="width:100%; height:6%;">
<label for="id_start_date" style=" display:table; text-align: center;">Start date : </lable><input type="text" name="start_date" id="datetimepicker18" style="width:26%; height:120%;" readonly/>
<label>End date : </label><input type="text" name="end_date" id="datetimepicker19" style="width:26%; height:120%;" readonly/>
</div>
<div style="width:100%; height:10%;">
<p align="left" style="padding-left:23px;"><label>Priority : </label>
<select method="post" name="priority_post">
<option value="1" id="id_priority_post2" name="priority_post" >High</option>
<option value="2" id="id_priority_post2" name="priority_post" >Medium</option>
<option value="3" id="id_priority_post2" name="priority_post" selected="selected">Low</option>
</select></p>
</div>
<div style="width:100%; height:23%;">
<center><input type="submit" name="bttnsubmit" value="Apply" ONCLICK="window.location.href='/'" style="height:30px; width:80px;" >
<input type="button" value="Cancel" ONCLICK="window.location.href='/'" style="height:30px; width:80px" ></center>
</div>
</font>
</form>
</div>
</div>
我怎么称呼弹出窗口:
<div style="width:5%; float:right;">
<div id="b-container">
<div class="photo" data-title="Edit"><a href="javascript:PopUpShow5({{ item.main_id }}, {{ item.id }}, "{{ item.description }}", "{{ item.data_date|date:'Y-m-d H:i' }}", "{{ item.end_date|date:'Y-m-d H:i' }}", {{ item.priority }}, {{ item.status }}, "Edit item")"><input type="image" src="{{ STATIC_URL }}images/edit.png" border="0" width="17" height="17" </a></div>
</div>
</div>
P.S。其他变量正确地发布到django ......