(我搜索过类似的东西,但没有找到任何匹配和/或有效的东西)
我有一个进度审核表单,用户可以在其中查看之前步骤中的设置。以下是我现在拥有的表格:
<form id='reviewForm' name='reviewForm' action='?action=ae&view=makeWorkFlow' method='post'>
<table width='100%'>
<tr>
<th width='150'>Workflow Name</th>
<td>" . $workflowName . "</td>
</tr>
<tr>
<th valign='top'>Tasks</th>
<td>
<table width='99%'>
<tr>
<td>
<select name='task_1'>
<option value='0'>Select a Task</option>
<ALL OTHER OPTIONS>
</select>
</td>
<td><input type='text' name='turnAround_1' value='#VALUE#' onkeyup="if (/[a-z\s,$]/ig.test(this.value)) this.value = this.value.replace(/[a-z\s,$]/ig,'')" placeholder='Turn Around Time (hours)' /> Hours</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan='2'>
<input type='hidden' id='step' name='step' value='4' />
<input type='submit' name='submit' value='Create Workflow' />
<input type='button' value='Update Changes' onclick='setStep();' />
<input type='button' value='Cancel' onclick='javascript:history.go(-3);' />
</td>
</tr>
</table>
</form>
因此,基本上,用户已经从下拉列表中选择了项目。我需要向他们展示一个“审查”页面,他们可以在其中选择更改他们的选择并单击“更新更改”按钮。点击那个按钮时,需要将“step”隐藏字段的值从4改为3,然后通过“setStep”函数提交表单,如下:
<script language='JavaScript' type='text/javascript'>
function setStep()
{
document.forms["reviewForm"].step.value = 3;
var t = setTimeout("document.reviewForm.submit();", 0);
}
</script>
我意识到 setTimeout 并不是最好的方法,但这正是我现在试图解决这个问题的地方。我敢肯定这是我缺少的一些小东西可以解决这个问题,但我已经在这个地方待了一个多小时,但找不到它。