我希望能够在确认框中包含考试名称,目前它不显示考试名称。有谁知道为什么?考试名称来自应发布的文本输入。
以下是包含考试名称文本输入的表单:
<?php
$newassessment = (isset($_POST['Assessmentnew'])) ? $_POST['Assessmentnew'] : '';
$editsession = "<form action=".htmlentities($_SERVER['PHP_SELF'])." method='post' id='updateForm'>
<table>
<tr>
<th>Assessment:</th>
<td><input type='text' id='newAssessment' name='Assessmentnew' readonly='readonly' value='' /> </td>
</tr>
</table>
<p><input id='updateSubmit' type='submit' value='Update Date/Start Time' name='updateSubmit' onClick='myClickHandler(); return false;'/></p>
</form>
";
echo $editsession;
}
?>
下面是确认框:
<script type="text/javascript">
function showConfirm(){
var confirmMsg=confirm("Are you sure you want to update the following:" + "\n" + "Exam: " <?php echo $newassessment ?> );
if (confirmMsg==true)
{
submitform();
}
}
</script>