不知道我解释这个是否正确我有一个带有提交按钮的表单我有问题
1:如果在提交时我禁用提交按钮,Jquery 永远不会完成不知道为什么。2:如果没有发布后的进度条,我将直接进入一个页面,该页面显示数据已保存到 SQL 数据库中,进度条在同一表单页面中显示此信息,不知道如何以另一种方式工作进度条。
任何帮助,将不胜感激!
//Add
if ($action == 'Add') {
echo '<p align="center" class="mainpagefontadminheader">ESE Web Site Projects Administration - Add Projects - ' . $_POST['table'] . '</p>
<br>
<form action="adminese_work.php" method="post" enctype="multipart/form-data" name="form" id="form">
<input type="hidden" name="table" value="' . $_POST['table'] . '"/>
<hr width="600">
<p class="mainpagefontadmin">Project Name: <input type="text" name="name" id="name" size="32" class="formelements"/></p>
<hr width="600">
<p class="mainpagefontadmin">Project Location: <input type="text" name="location" id="location" size="30" class="formelements"/></p>
<hr width="600">
<p class="mainpagefontadmin">Project Verbage: <textarea name="verbage" id="verbage" cols="45" rows="5" class="formelements"></textarea> </p>
<hr width="600">
<p class="mainpagefontadmin">Project Main Photo: <input type="file" name="mainphoto" id="mainphoto" class="mainpagefontadmin"/><br />Please make sure your pixels are:(890x350)</p>
<hr width="600">
<p class="mainpagefontadmin">Project Thumbnails: <input type="button" onclick="addInput()" name="add" value="Add Upload Field" class="formelements"/> Click to Add More Upload Fields.</p>
<div id="images">
</div>
<hr width="600">
<span class="mainpagefontadmin">Maximum Post Size: 50 Megabytes.</span>
<div class="progress">
<div class="bar"></div >
<div class="percent">0%</div >
</div>
<div id="status"></div>
<hr width="600">
<br>
<table width="0" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input type="submit" name="Save" id="button" value="Save"></td>
<td><input type="submit" name="Cancel" id="button" value="Cancel"></td>
</tr>
</table>
</form>
<script src="java/jquery.js"></script>
<script src="java/jquery.form.js"></script>
<script>
(function() {
var bar = $(\'.bar\');
var percent = $(\'.percent\');
var status = $(\'#status\');
$(\'form\').ajaxForm({
beforeSend: function() {
status.empty();
var percentVal = \'0%\';
bar.width(percentVal)
percent.html(percentVal);
},
uploadProgress: function(event, position, total, percentComplete) {
var percentVal = percentComplete + \'%\';
bar.width(percentVal)
percent.html(percentVal);
},
complete: function(xhr) {
bar.width("100%");
percent.html("100%");
status.html(xhr.responseText);
}
});
})();
</script>';
}
保存按钮调用
if ($action == 'Save') {}
该信息应该显示在另一个页面中,而不是上面的同一页面
希望这是有道理的。
谢谢