我一生都在尝试在具有特定输入(数字 4 及更高)的表单中显示隐藏字段。
JS:
function showStuff(id) {
document.getElementById(id).style.display = 'block';
}
HTML:
<tr valign="top">
<td <? if(strstr($Error,"intern_openings")){ ?> class="error" <? } ?>>*Number of Interns/<br>Available positions:</td>
<td colspan="2"><input type="text" name="intern_openings" size="3" maxlength="3" value="<?=$intern_openings?>" onkeyup="javascript:showStuff('supervisorname')"><br />
<div id="supervisorname" style="display:none;">
<br />
Names of intern supervisors (employer staff):<br />
<input type="text" name="supervisor[]" value="<?=$supervisor?>" <? if(strstr($supervisorList)){ ?> <? } ?>><br />
<input type="text" name="supervisor[]" value="<?=$supervisor?>" <? if(strstr($supervisorList)){ ?> <? } ?>><br />
<input type="text" name="supervisor[]" value="<?=$supervisor?>" <? if(strstr($supervisorList)){ ?> <? } ?>><br />
<input type="text" name="supervisor[]" value="<?=$supervisor?>" <? if(strstr($supervisorList)){ ?> <? } ?>>
</div>
</td>
</tr>
任何见解都将是完全激进的。