【发布时间】:2018-06-18 13:01:42
【问题描述】:
我在页面上有 3 个提交按钮。
<form class="" action="" method="POST">
<button type="submit" name="type" class="btn mosh-btn mosh-btn-2" value="elevator">ლფტის შეკვეთა</button>
<button type="submit" name="type" class="btn mosh-btn mosh-btn-2" value="eskalator">ესკალატორის შეკვეთა</button>
<button type="submit" name="type" class="btn mosh-btn mosh-btn-2" value="parts">ნაწილების შეკვეთა</button>
</form>
和php代码:
if (!isset($_POST['type']))
{
include 'inc/liftorderform.php';
}elseif ($_POST['type'] == 'elevator')
{
include 'inc/liftorderform.php';
}elseif ($_POST['type'] == 'eskalator')
{
include 'inc/eskalatororderform.php';
}elseif ($_POST['type'] == 'parts')
{
include 'inc/partsorderform.php';
}
我如何在不刷新页面的情况下执行此操作。请帮忙
【问题讨论】:
-
如果您想在不刷新页面的情况下执行此操作,请尝试阅读 AJAX
-
不刷新仅适用于 Ajax 请求,如下所示:stackoverflow.com/questions/21612197/…