因我的愚蠢而编辑:
我有一个简单的 html 表单,带有基本的选择、文本和文本区域输入。提交后,表单会返回某些字段的空白,但不是全部。下面是表格:
<form action='?action=createDigitalJob' method='post'>
<table width='100%'>
<tr>
<th align='left'>Job Type</th>
<td>
<select id='jobTypeID' name='jobType' style='width:250px;' onchange=\"digitalJobToggle('jobTypeID')\">
<option value='0'>Count Type </option>
<option value='wu'>Web Update </option>
<option value='purl'>PURL </option>
<option value='furl'>FURL </option>
<option value='gurl'>GURL </option>
<option value='domain'>Domain Purchase </option>
<option value='eblast'>E-Blast </option>
<option value='tdm'>TDM </option>
<option value='crm'>ORM </option>
</select>
</td>
</tr>
<tr>
<th align='left'>Urgent</th>
<td>
<select name='isUrgent'>
<option value='No'>No </option>
<option value='Yes'>Yes </option>
</select>
</td>
</tr>
<tr id='wu' style='display:none'>
<td colspan='2'>
<table class='plain'>
<tr>
<td>Webpage Address</td>
<td><input type=\"text\" name=\"webpageAddress\" /></td>
</tr>
<tr>
<td valign='top'>Current Text</td>
<td><textarea name='currentText' style='width:500px; height:250px;' placeholder='Current Text' ></textarea></td>
</tr>
<tr>
<td valign='top'>New Text</td>
<td><textarea name='newText' style='width:500px; height:250px;' placeholder='New Text Text' ></textarea></td>
</tr>
<tr>
<td>Copy Proofed?</td>
<td>
<select name='copyProofed'>
<option value='No'>No </option>
<option value='Yes'>Yes </option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr id='submitRow' style='display:none'>
<td colspan='2'>
<input type='hidden' name='step' value='2' />
<input type='submit' name='submit' value='Submit' />
<input type='button' value='Cancel' onclick='javascript:history.go(-1);' />
</td>
</tr>
</table>
</form>
提交表单后,我可以执行 print_r($_POST) 并收到以下信息:
数组 ( [jobType] => wu [isUrgent] => 是 [webpageAddress] => [currentText] => 1 [newText] => [copyProofed] => 否 [creativeComplete] => 否 [jobNumber] => [phoneVerified] => 没有 [leadEmail] => [变量] => [pincodes] => 没有 [webpageAddress2] => [eblastType] => 数字 [subjectLine] => [copyApproved] => 没有 [dueDate_Month] => 1 [dueDate_Day] => 1 [dueDate_Year] => 2012 [notes] => 41 [step] => 2 [submit] => Submit )
如果我是 var_dump($_POST),我会得到:
array 'jobType' => string 'wu' (length=2) 'isUrgent' => string 'Yes' (length=3) 'webpageAddress' => string '' (length=0) 'currentText' => string '1 ' (length=1) 'newText' => string '' (length=0) 'copyProofed' => string 'No' (length=2) 'creativeComplete' => string 'No' (length=2) 'jobNumber' => string '' (length=0) 'phoneVerified' => string 'No' (length=2) 'leadEmail' => string '' (length=0) 'variables' => string '' (length=0) 'pincodes' => string 'No' (length=2) 'webpageAddress2' => string '' (length=0) 'eblastType' => string'数字'(长度=7)'subjectLine'=>字符串''(长度=0)'copyApproved'=>字符串'否'(长度=2)'dueDate_Month'=>字符串'1'(长度=1)'dueDate_Day ' => 字符串 '1' (length=1) 'dueDate_Year' => 字符串 '2012' (length=4) 'notes' => 字符串 '41' (length=2) 'step' => 字符串 '2' (长度=1) '提交' => 字符串'提交' (长度=6)notes' => string '41' (length=2) 'step' => string '2' (length=1) 'submit' => string 'Submit' (length=6)notes' => string '41' (length=2) 'step' => string '2' (length=1) 'submit' => string 'Submit' (length=6)
即使我在点击提交之前为它们输入了数据,两种类型的 $_POST 转储都显示为 pagesAddress 和 newText 的空值。有人知道为什么我输入的数据在 $_POST 转储中不可用吗?
有人知道这里发生了什么吗?