示例代码:
<html>
<?php
if( isset($_POST['cancele']) )
{
$link=true;
}
?>
<form id="eventform" name="selection" method="post">
<div id="starttime">
Pick event start time<br>
<input type="text" name="startdate" id="startdatepicker" value="<?php
echo $curDateDisp; ?>">
<input type="text" name="starttimehours" id="starttimehr" maxlength="2" style="width:18px" value="<?php echo $curTimeDispHr; ?>">:
<input type="text" name="starttimeminutes" id="starttimemin" maxlength="2" style="width:18px" value="<?php echo $curTimeDispMin; ?>">
</div>
<div id="stoptime">
Pick event stop time<br>
<input type="text" name="stopdate" id="stopdatepicker" value="<?php echo $futureDateDisp; ?>">
<input type="text" name="stoptimehours" id="stoptimehr" maxlength="2" style="width:18px" value="<?php echo $futureTimeDispHr; ?>">:
<input type="text" name="stoptimeminutes" id="stoptimemin" maxlength="2" style="width:18px" value="<?php echo $futureTimeDispMin; ?>">
</div>
<div id="callinterval">
Select call interval for event<br>
<select name="eventInterval">
<option value="300" <?php if($edit && $eventinterval==300) echo 'selected'; ?>>5 minutes</option>
<option value="600" <?php if(!$edit || $eventinterval==600) echo 'selected'; ?>>10 minutes</option>
<option value="900" <?php if($edit && $eventinterval==900) echo 'selected'; ?>>15 minutes</option>
<option value="1800" <?php if($edit && $eventinterval==1800) echo 'selected'; ?>>30 minutes</option>
<option value="3600" <?php if($edit && $eventinterval==3600) echo 'selected'; ?>>1 hour</option>
<option value="86400" <?php if($edit && $eventinterval==86400) echo 'selected'; ?>>1 day</option>
</select>
</div>
<br>
<div>
<input id="scheduleokbutton" type="submit" onclick="return validateForm()" action="scheduleevent.php" value="Add Event">
</div>
<br>
<div>
<input id="canceleventbutton" alt="center" name="cancele" type="submit" onclick="cancelEvent()" action="scheduleevent.php" value="Cancel Event">
</div>
<br>
<br>
<br>
</form>
</html>
我正在尝试在按下取消按钮时更改表单数据,并且我正在使用isset()函数。它似乎无法在Firefox和Safari浏览器中工作,它在Chrome IE11和边缘浏览器中工作正常。在firefox和safari中,由于某种原因它不会进入isset状态。有人可以帮忙吗?